Bug 13536 fixes an issue for 1 specific datetime. I would like to make this possible for all date fields.
Created attachment 35539 [details] [review] Bug 13536: Display a datetime without time in a notice For some needs, a librarian would like to display a datetime or timestamp field without the time. This patch a filter logic in the notice/letter parsing process. Test plan: 1/ Defined a notice using a datetime or timestamp DB field (biblio.timestamp for instance). 2/ Generate the notice 3/ Verify that the letter is generated with the time 4/ Use the "dateonly" filter like: <<your_table.your_field | dateonly>> <<biblio.timestamp | dateonly>> 5/ Generate the notice 6/ Confirm the the letter is generated without the time for this field.
Interesting idea! How might this factor in for <<items.content>> where you might have multiple dates in the content?
(In reply to David Cook from comment #2) > Interesting idea! How might this factor in for <<items.content>> where you > might have multiple dates in the content? It won't work for items.content. This is a special case managed in cronjob script (overdue_notices.pl and advance_notices.pl).
(In reply to Jonathan Druart from comment #3) > (In reply to David Cook from comment #2) > > Interesting idea! How might this factor in for <<items.content>> where you > > might have multiple dates in the content? > > It won't work for items.content. > This is a special case managed in cronjob script (overdue_notices.pl and > advance_notices.pl). Ah, right. Of course. You and I were the people on those bugs too, so I should've remembered. Cool beans :)
I think the best solution would be to automatically strip times from items due at 23:59 Would this not solve the issue completely without the need for any special markup?
(In reply to Kyle M Hall from comment #5) > I think the best solution would be to automatically strip times from items > due at 23:59 > > Would this not solve the issue completely without the need for any special > markup? This patch offers more than the due date.
Reintroduce this one in the needs signoff queue, there is no discussion and I think this patch could bring a global solution to date formatting in notices.
We had another library asking for this - it would be nice to see it moving.
Created attachment 39281 [details] [review] Bug 13622: Display a datetime without time in a notice For some needs, a librarian would like to display a datetime or timestamp field without the time. This patch adds filter logic in the notice/letter parsing process. Test plan: 1/ Defined a notice using a datetime or timestamp DB field (biblio.timestamp for instance). 2/ Generate the notice 3/ Verify that the letter is generated with the time 4/ Use the "dateonly" filter like: <<your_table.your_field | dateonly>> <<biblio.timestamp | dateonly>> 5/ Generate the notice 6/ Confirm the the letter is generated without the time for this field. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Created attachment 39282 [details] [review] Bug 13622: [QA Follow-up] Add unit test descriptions This report adds a few unit tests for datonly flag in notices. This patch adds (very trivial) unit test descriptions. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Here we have it moving again :) I will close report 13536 now; this is more global. The discussion status did not bring us any news. Point of attention: the feature needs to be documented somewhere..
*** Bug 13536 has been marked as a duplicate of this bug. ***
this could prolly use a Passed QA status ;-)
... or another sign-off to give QA more incentive! ;)
Created attachment 40794 [details] [review] Bug 13622: Display a datetime without time in a notice For some needs, a librarian would like to display a datetime or timestamp field without the time. This patch adds filter logic in the notice/letter parsing process. Test plan: 1/ Defined a notice using a datetime or timestamp DB field (biblio.timestamp for instance). 2/ Generate the notice 3/ Verify that the letter is generated with the time 4/ Use the "dateonly" filter like: <<your_table.your_field | dateonly>> <<biblio.timestamp | dateonly>> 5/ Generate the notice 6/ Confirm the the letter is generated without the time for this field. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Indranil Das Gupta (L2C2 Technologies) <indradg@gmail.com> Updated the count of tests to 64 for t/db_dependent/Letters.t to pass
Created attachment 40795 [details] [review] Bug 13622: [QA Follow-up] Add unit test descriptions This report adds a few unit tests for datonly flag in notices. This patch adds (very trivial) unit test descriptions. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Indranil Das Gupta (L2C2 Technologies) <indradg@gmail.com>
(In reply to Katrin Fischer from comment #14) > ... or another sign-off to give QA more incentive! ;) heh! done... updated the tests count in t/db_dependent/Letters.t to 64 (it is already 61 in the current master). Hope I've not messed up the author this time.
Patches look ok to me on first glance, thx Indranil!
(In reply to Katrin Fischer from comment #18) > Patches look ok to me on first glance, thx Indranil! They have a double signoff. What's holding you back?
Created attachment 42519 [details] [review] Bug 13622: Display a datetime without time in a notice For some needs, a librarian would like to display a datetime or timestamp field without the time. This patch adds filter logic in the notice/letter parsing process. Test plan: 1/ Defined a notice using a datetime or timestamp DB field (biblio.timestamp for instance). 2/ Generate the notice 3/ Verify that the letter is generated with the time 4/ Use the "dateonly" filter like: <<your_table.your_field | dateonly>> <<biblio.timestamp | dateonly>> 5/ Generate the notice 6/ Confirm the the letter is generated without the time for this field. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Indranil Das Gupta (L2C2 Technologies) <indradg@gmail.com> Updated the count of tests to 64 for t/db_dependent/Letters.t to pass
Created attachment 42520 [details] [review] Bug 13622: [QA Follow-up] Add unit test descriptions This report adds a few unit tests for datonly flag in notices. This patch adds (very trivial) unit test descriptions. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Indranil Das Gupta (L2C2 Technologies) <indradg@gmail.com>
QA Comment: I am taking the liberty to pass qa on this report. Since Indranil signed off on both patches, I gain my QA token again.. Works as described. QA tests pass. The feature is kind of undocumented now. It should be described somewhere (help page, manual, on the form??) The code in Letters.pm is already less maintainable and this fix will not improve the situation. But it is a global solution and it is in written in a way that could[..] be extended with similar filters. The three added tests are testing the same thing. Seems to be overkill. I could better understand your testing the same report with dateonly flag and without it to show the difference. But no big deal. Passed QA
(In reply to Marcel de Rooy from comment #22) > The three added tests are testing the same thing. Seems to be overkill. No, they test different patterns: table.field | filter field | filter field|filter
Patches pushed to master. Thanks Jonathan and Marcel!