[Koha-bugs] [Bug 24455] Date formatting from JS
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24455 Agustín Moyano changed: What|Removed |Added Blocks||25328 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25328 [Bug 25328] Date formatting from JS - Remove tz handling -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 24455] Date formatting from JS
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24455 Agustín Moyano changed: What|Removed |Added Blocks|20936 | Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20936 [Bug 20936] Holds History for patrons in OPAC -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 24455] Date formatting from JS
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24455 Katrin Fischer changed: What|Removed |Added Component|OPAC|Architecture, internals, ||and plumbing Text to go in the|This patchset lays the |This patchset lays the release notes|foundations for applying|foundations for applying |date formatting as |date formatting as |described in the koha |described in the Koha |system preferences to |system preferences to |datetimes returned by the |datetimes returned by the |API in RFC3339 format. |API in RFC3339 format. -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 24455] date formatting from JS
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24455 Agustín Moyano changed: What|Removed |Added Attachment #97578|0 |1 is obsolete|| --- Comment #9 from Agustín Moyano --- Created attachment 98625 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=98625&action=edit Bug 24455: Add JS functions to format date and datetime strings This patch adds the a js-date-format.inc file on each opac and staff interface (date-format.inc whas not available as name) When you include that file in your TT, you'll get the following functions available: 1. $date(raw_date_string, options) This function parses a date string, as produced by an api call, and returns the corresponding date formatted according to 'dateformat' and 'TimeFormat' parameters. For example: // dateformat: us // timeformat: 12hr // Timezone: UTC $date('2020-03-23T15:00:00+01:00') // You will get '03/23/2020' $date('2020-03-23T15:00:00+01:00', {withtime: true}) // You will get '03/23/2020 14:00' $date('2020-03-23T15:00:00+01:00', {withtime: true, tz: 'Europe/Paris'}) // You will get '03/23/2020 15:00+01:00' Options: * dateformat: override date format as configured in staff interface (accepts also 'rfc3339') * timeformat: override time format as configured in staff client (available options are '12hr' and '24hr') * withtime: also print the time part (default false) * tz: set the timezone 2. $datetime(raw_date_string, option) The same as $date but sets withtime to true 3. $time(raw_date_string, option) The same as $datetime but shows only the time part To test you must implement and test bug 20936, where it will be used -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 24455] date formatting from JS
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24455 Tomás Cohen Arazi changed: What|Removed |Added See Also||https://bugs.koha-community ||.org/bugzilla3/show_bug.cgi ||?id=24650 -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 24455] date formatting from JS
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24455 --- Comment #10 from Jonathan Druart --- Typo: +var tz = (opitons&&options.tz)||def_tz; How is this related to bug 24650? It seems that it achieves the same goal without extra lib and very few lines. -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 24455] date formatting from JS
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24455 --- Comment #11 from Agustín Moyano --- (In reply to Jonathan Druart from comment #10) > Typo: > +var tz = (opitons&&options.tz)||def_tz; Ups, seems I forgot to attach the patch where I fixed that.. > How is this related to bug 24650? > It seems that it achieves the same goal without extra lib and very few lines. I hadn't seen that bug.. seems this bug is previous to that one.. but the main difference is that this implementation takes into account the timezone, so if a date comes from the api with UTC timezone it will be correctly translated to your current timezone. -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 24455] date formatting from JS
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24455 --- Comment #12 from Jonathan Druart --- Created attachment 99192 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=99192&action=edit test tz -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 24455] date formatting from JS
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24455 --- Comment #13 from Jonathan Druart --- (In reply to Agustín Moyano from comment #11) > (In reply to Jonathan Druart from comment #10) > > How is this related to bug 24650? > > It seems that it achieves the same goal without extra lib and very few > > lines. > > I hadn't seen that bug.. seems this bug is previous to that one.. but the > main difference is that this implementation takes into account the timezone, > so if a date comes from the api with UTC timezone it will be correctly > translated to your current timezone. What do you mean by correctly translated to your current timezone? Do you mean the TZ from the server? I tried this patch, with Buenos Aires in the timezone config, I see: 2020-02-18T12:46:05-03:00 02/18/2020 16:46 (current date of the server is 16:46) -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 24455] date formatting from JS
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24455 Agustín Moyano changed: What|Removed |Added Attachment #98625|0 |1 is obsolete|| --- Comment #14 from Agustín Moyano --- Created attachment 99195 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=99195&action=edit Bug 24455: Add JS functions to format date and datetime strings This patch adds the a js-date-format.inc file on each opac and staff interface (date-format.inc whas not available as name) When you include that file in your TT, you'll get the following functions available: 1. $date(raw_date_string, options) This function parses a date string, as produced by an api call, and returns the corresponding date formatted according to 'dateformat' and 'TimeFormat' parameters. For example: // dateformat: us // timeformat: 12hr // Timezone: UTC $date('2020-03-23T15:00:00+01:00') // You will get '03/23/2020' $date('2020-03-23T15:00:00+01:00', {withtime: true}) // You will get '03/23/2020 14:00' $date('2020-03-23T15:00:00+01:00', {withtime: true, tz: 'Europe/Paris'}) // You will get '03/23/2020 15:00+01:00' Options: * dateformat: override date format as configured in staff interface (accepts also 'rfc3339') * timeformat: override time format as configured in staff client (available options are '12hr' and '24hr') * withtime: also print the time part (default false) * tz: set the timezone 2. $datetime(raw_date_string, option) The same as $date but sets withtime to true 3. $time(raw_date_string, option) The same as $datetime but shows only the time part To test you must implement and test bug 20936, where it will be used -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 24455] date formatting from JS
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24455 --- Comment #15 from Agustín Moyano --- (In reply to Jonathan Druart from comment #13) > (In reply to Agustín Moyano from comment #11) > > (In reply to Jonathan Druart from comment #10) > > > How is this related to bug 24650? > > > It seems that it achieves the same goal without extra lib and very few > > > lines. > > > > I hadn't seen that bug.. seems this bug is previous to that one.. but the > > main difference is that this implementation takes into account the timezone, > > so if a date comes from the api with UTC timezone it will be correctly > > translated to your current timezone. > > What do you mean by correctly translated to your current timezone? Do you > mean the TZ from the server? > > I tried this patch, with Buenos Aires in the timezone config, I see: > 2020-02-18T12:46:05-03:00 > 02/18/2020 16:46 > > (current date of the server is 16:46) according to the patch your uploaded, I believe you where using the code of bug 24650. I'll try to upload a patch with [DO NOT PUSH] with a test case -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 24455] date formatting from JS
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24455 Agustín Moyano changed: What|Removed |Added Attachment #99192|0 |1 is obsolete|| --- Comment #16 from Agustín Moyano --- Created attachment 99198 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=99198&action=edit [DO NOT PUSH] Bug 24455: test timezone This is just a test.. I added the .inc file to adimn's main page To test: 1. go to Koha main page and open chrome or firefox console 2. type $datetime('2020-02-18T12:46:05Z', {tz: 'America/Argentina/Buenos_Aires'}) and you should get "02/18/2020 09:46" because America/Argentina/Buenos_Aires is -03:00 3. type $datetime('2020-02-18T12:46:05Z', {tz: 'Asia/Shanghai'}) and you should get "02/18/2020 20:46" because Asia/Shanghai is +08:00 4. type $datetime('2020-02-18T12:46:05Z') and it should be translated to your koha instance configured timezone. -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 24455] date formatting from JS
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24455 --- Comment #17 from Jonathan Druart --- So, in your opinion, do we need both approaches or only one? (bug 24455 and bug 24650) I miss the real-life use case. -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 24455] date formatting from JS
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24455 --- Comment #18 from Agustín Moyano --- (In reply to Jonathan Druart from comment #17) > So, in your opinion, do we need both approaches or only one? (bug 24455 and > bug 24650) I believe both do basically the same > I miss the real-life use case. https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=98630&action=diff#a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-holdsrecord.tt_sec1 In line 170, I use it to format dates retrieved from the API into datatables. -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 24455] date formatting from JS
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24455 Andrew Isherwood changed: What|Removed |Added CC||andrew.isherwood@ptfs-europ ||e.com --- Comment #19 from Andrew Isherwood --- I'd say this bug looks far more useful than mine in bug 24650, which only solves a single problem I had. If we are moving more towards API driven interfaces, the need to reliably parse and manipulate dates in JS is crucial. Since moment.js is the defacto way of doing this in JS, it seems by far the best way forward. I'll apply and sign this off now. -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 24455] date formatting from JS
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24455 Andrew Isherwood changed: What|Removed |Added Attachment #97575|0 |1 is obsolete|| --- Comment #21 from Andrew Isherwood --- Created attachment 99870 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=99870&action=edit Bug 24455: Add moment library in staff This patch adds koha-tmpl/intranet-tmpl/lib/moment/moment.min.js in order to use the moment library (https://momentjs.com/) Signed-off-by: Andrew Isherwood -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 24455] date formatting from JS
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24455 Andrew Isherwood changed: What|Removed |Added Attachment #97574|0 |1 is obsolete|| --- Comment #20 from Andrew Isherwood --- Created attachment 99869 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=99869&action=edit Bug 24455: Add moment library in opac This patch adds koha-tmpl/opac-tmpl/bootstrap/lib/moment.min.js in order to use the moment library (https://momentjs.com/) Signed-off-by: Andrew Isherwood -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 24455] date formatting from JS
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24455 Andrew Isherwood changed: What|Removed |Added Attachment #97576|0 |1 is obsolete|| --- Comment #22 from Andrew Isherwood --- Created attachment 99871 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=99871&action=edit Bug 24455: Add moment-timezone library in opac This patch adds koha-tmpl/opac-tmpl/bootstrap/lib/moment-timezone-with-data-10-year-range.min.js in order to use the moment library with timezones (https://momentjs.com/timezone/) Signed-off-by: Andrew Isherwood -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 24455] date formatting from JS
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24455 --- Comment #25 from Andrew Isherwood --- Created attachment 99874 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=99874&action=edit Bug 24455: test timezone This is just a test.. I added the .inc file to adimn's main page To test: 1. go to Koha main page and open chrome or firefox console 2. type $datetime('2020-02-18T12:46:05Z', {tz: 'America/Argentina/Buenos_Aires'}) and you should get "02/18/2020 09:46" because America/Argentina/Buenos_Aires is -03:00 3. type $datetime('2020-02-18T12:46:05Z', {tz: 'Asia/Shanghai'}) and you should get "02/18/2020 20:46" because Asia/Shanghai is +08:00 4. type $datetime('2020-02-18T12:46:05Z') and it should be translated to your koha instance configured timezone. -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 24455] date formatting from JS
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24455 Andrew Isherwood changed: What|Removed |Added Attachment #99195|0 |1 is obsolete|| --- Comment #24 from Andrew Isherwood --- Created attachment 99873 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=99873&action=edit Bug 24455: Add JS functions to format date and datetime strings This patch adds the a js-date-format.inc file on each opac and staff interface (date-format.inc whas not available as name) When you include that file in your TT, you'll get the following functions available: 1. $date(raw_date_string, options) This function parses a date string, as produced by an api call, and returns the corresponding date formatted according to 'dateformat' and 'TimeFormat' parameters. For example: // dateformat: us // timeformat: 12hr // Timezone: UTC $date('2020-03-23T15:00:00+01:00') // You will get '03/23/2020' $date('2020-03-23T15:00:00+01:00', {withtime: true}) // You will get '03/23/2020 14:00' $date('2020-03-23T15:00:00+01:00', {withtime: true, tz: 'Europe/Paris'}) // You will get '03/23/2020 15:00+01:00' Options: * dateformat: override date format as configured in staff interface (accepts also 'rfc3339') * timeformat: override time format as configured in staff client (available options are '12hr' and '24hr') * withtime: also print the time part (default false) * tz: set the timezone 2. $datetime(raw_date_string, option) The same as $date but sets withtime to true 3. $time(raw_date_string, option) The same as $datetime but shows only the time part To test you must implement and test bug 20936, where it will be used Signed-off-by: Andrew Isherwood -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 24455] date formatting from JS
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24455 Andrew Isherwood changed: What|Removed |Added Attachment #97577|0 |1 is obsolete|| --- Comment #23 from Andrew Isherwood --- Created attachment 99872 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=99872&action=edit Bug 24455: Add moment-timezone library in staff This patch adds koha-tmpl/intranet-tmpl/lib/moment/moment-timezone-with-data-10-year-range.min.js in order to use the moment library with timezones (https://momentjs.com/timezone/) Signed-off-by: Andrew Isherwood -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 24455] date formatting from JS
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24455 --- Comment #26 from Andrew Isherwood --- Created attachment 99875 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=99875&action=edit Bug 24455: [DO NOT PUSH] test timezone This is just a test.. I added the .inc file to adimn's main page To test: 1. go to Koha main page and open chrome or firefox console 2. type $datetime('2020-02-18T12:46:05Z', {tz: 'America/Argentina/Buenos_Aires'}) and you should get "02/18/2020 09:46" because America/Argentina/Buenos_Aires is -03:00 3. type $datetime('2020-02-18T12:46:05Z', {tz: 'Asia/Shanghai'}) and you should get "02/18/2020 20:46" because Asia/Shanghai is +08:00 4. type $datetime('2020-02-18T12:46:05Z') and it should be translated to your koha instance configured timezone. -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 24455] date formatting from JS
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24455 Andrew Isherwood changed: What|Removed |Added Attachment #99198|0 |1 is obsolete|| -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 24455] date formatting from JS
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24455 Andrew Isherwood changed: What|Removed |Added Attachment #99874|0 |1 is obsolete|| -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 24455] date formatting from JS
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24455 Andrew Isherwood changed: What|Removed |Added Status|Needs Signoff |Signed Off --- Comment #27 from Andrew Isherwood --- Signed off on the basis of passing the tests in comment #16 -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 24455] Date formatting from JS
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24455 Katrin Fischer changed: What|Removed |Added Summary|date formatting from JS |Date formatting from JS CC||katrin.fisc...@bsz-bw.de --- Comment #28 from Katrin Fischer --- Thx, Andrew! If this solves your need - should we mark bug 24650 duplicate or resolved moved? -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 24455] Date formatting from JS
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24455 Andrew Isherwood changed: What|Removed |Added Blocks||24608 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24608 [Bug 24608] Allow modification of checkout due date -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 24455] Date formatting from JS
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24455 --- Comment #29 from Andrew Isherwood --- *** Bug 24650 has been marked as a duplicate of this bug. *** -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 24455] Date formatting from JS
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24455 --- Comment #30 from Andrew Isherwood --- (In reply to Katrin Fischer from comment #28) > Thx, Andrew! If this solves your need - should we mark bug 24650 duplicate > or resolved moved? Done :) -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 24455] Date formatting from JS
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24455 Tomás Cohen Arazi changed: What|Removed |Added Blocks||20212 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20212 [Bug 20212] Slowness in Receiving in Acquisitions -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 24455] Date formatting from JS
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24455 Kyle M Hall changed: What|Removed |Added Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 24455] Date formatting from JS
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24455 Kyle M Hall changed: What|Removed |Added Attachment #99869|0 |1 is obsolete|| Attachment #99870|0 |1 is obsolete|| Attachment #99871|0 |1 is obsolete|| Attachment #99872|0 |1 is obsolete|| Attachment #99873|0 |1 is obsolete|| Attachment #99875|0 |1 is obsolete|| --- Comment #31 from Kyle M Hall --- Created attachment 100119 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=100119&action=edit Bug 24455: Add moment library in opac This patch adds koha-tmpl/opac-tmpl/bootstrap/lib/moment.min.js in order to use the moment library (https://momentjs.com/) Signed-off-by: Andrew Isherwood Signed-off-by: Kyle M Hall -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 24455] Date formatting from JS
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24455 --- Comment #32 from Kyle M Hall --- Created attachment 100120 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=100120&action=edit Bug 24455: Add moment library in staff This patch adds koha-tmpl/intranet-tmpl/lib/moment/moment.min.js in order to use the moment library (https://momentjs.com/) Signed-off-by: Andrew Isherwood Signed-off-by: Kyle M Hall -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 24455] Date formatting from JS
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24455 --- Comment #33 from Kyle M Hall --- Created attachment 100121 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=100121&action=edit Bug 24455: Add moment-timezone library in opac This patch adds koha-tmpl/opac-tmpl/bootstrap/lib/moment-timezone-with-data-10-year-range.min.js in order to use the moment library with timezones (https://momentjs.com/timezone/) Signed-off-by: Andrew Isherwood Signed-off-by: Kyle M Hall -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 24455] Date formatting from JS
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24455 --- Comment #35 from Kyle M Hall --- Created attachment 100123 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=100123&action=edit Bug 24455: Add JS functions to format date and datetime strings This patch adds the a js-date-format.inc file on each opac and staff interface (date-format.inc whas not available as name) When you include that file in your TT, you'll get the following functions available: 1. $date(raw_date_string, options) This function parses a date string, as produced by an api call, and returns the corresponding date formatted according to 'dateformat' and 'TimeFormat' parameters. For example: // dateformat: us // timeformat: 12hr // Timezone: UTC $date('2020-03-23T15:00:00+01:00') // You will get '03/23/2020' $date('2020-03-23T15:00:00+01:00', {withtime: true}) // You will get '03/23/2020 14:00' $date('2020-03-23T15:00:00+01:00', {withtime: true, tz: 'Europe/Paris'}) // You will get '03/23/2020 15:00+01:00' Options: * dateformat: override date format as configured in staff interface (accepts also 'rfc3339') * timeformat: override time format as configured in staff client (available options are '12hr' and '24hr') * withtime: also print the time part (default false) * tz: set the timezone 2. $datetime(raw_date_string, option) The same as $date but sets withtime to true 3. $time(raw_date_string, option) The same as $datetime but shows only the time part To test you must implement and test bug 20936, where it will be used Signed-off-by: Andrew Isherwood Signed-off-by: Kyle M Hall -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 24455] Date formatting from JS
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24455 --- Comment #34 from Kyle M Hall --- Created attachment 100122 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=100122&action=edit Bug 24455: Add moment-timezone library in staff This patch adds koha-tmpl/intranet-tmpl/lib/moment/moment-timezone-with-data-10-year-range.min.js in order to use the moment library with timezones (https://momentjs.com/timezone/) Signed-off-by: Andrew Isherwood Signed-off-by: Kyle M Hall -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 24455] Date formatting from JS
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24455 --- Comment #36 from Kyle M Hall --- Created attachment 100124 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=100124&action=edit Bug 24455: [DO NOT PUSH] test timezone This is just a test.. I added the .inc file to adimn's main page To test: 1. go to Koha main page and open chrome or firefox console 2. type $datetime('2020-02-18T12:46:05Z', {tz: 'America/Argentina/Buenos_Aires'}) and you should get "02/18/2020 09:46" because America/Argentina/Buenos_Aires is -03:00 3. type $datetime('2020-02-18T12:46:05Z', {tz: 'Asia/Shanghai'}) and you should get "02/18/2020 20:46" because Asia/Shanghai is +08:00 4. type $datetime('2020-02-18T12:46:05Z') and it should be translated to your koha instance configured timezone. Signed-off-by: Kyle M Hall -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 24455] Date formatting from JS
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24455 --- Comment #37 from Kyle M Hall --- Created attachment 100125 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=100125&action=edit Bug 24455: Add Moment.js to About page Signed-off-by: Kyle M Hall -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 24455] Date formatting from JS
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24455 --- Comment #38 from Jonathan Druart --- WARNING: This must NOT be pushed before I have a better clarity of the needs. This does not need to be pushed before one of the 2 dependent bugs anyway. See for instance bug 24608 comment 26. (This bug does not need to be marked as blocked, the dep is the other way around) -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 24455] Date formatting from JS
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24455 Martin Renvoize changed: What|Removed |Added See Also||https://bugs.koha-community ||.org/bugzilla3/show_bug.cgi ||?id=24850 -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 24455] Date formatting from JS
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24455 Martin Renvoize changed: What|Removed |Added CC||martin.renvoize@ptfs-europe ||.com --- Comment #39 from Martin Renvoize --- I'm facing similar challenges here as I did with bug 24454. Now I'm wrapping my head around it, there seems to be a fair bit of duplicate code introduced here that already exists in koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc I'm by no means against introducing moment.js, I like the idea of using well maintained and thought out third party libraries and the was of accessing the functions written here is nice and elegant.. much like the way you introduced elegant accessors for currency handling in bug 24454 (I'd like to see some of those idea's taken forward too). But.. I don't like that we're duplicating logic and making it somewhat less clear which functions should be used for the job so would like some form of merge/aggregation of such functionality and a clear documentation somewhere for how to use it before I'm happy pushing this. -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 24455] Date formatting from JS
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24455 Martin Renvoize changed: What|Removed |Added Status|Passed QA |Failed QA --- Comment #40 from Martin Renvoize --- Examples on things that need clarifying.. 1) Is the intention to always pass in a 'String' (and if so, of what format) to the new $date, $datetime and $time window functions.. or are you deliberately allow Date prototypes to be passed? 2) You allow to pass in a timezone in the options, but the string value may also include an offset if it's a RFC3339 so how are the two being ratified..? -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 24455] Date formatting from JS
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24455 --- Comment #41 from Martin Renvoize --- I'd be tempted to have some clearer function names.. like fromkohadate which would take a syspref formatted date string and return a moment prototype and tokohadate which would take a moment and return a string formatted per koha sysprefs ? -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 24455] Date formatting from JS
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24455 Tomás Cohen Arazi changed: What|Removed |Added Blocks|20212 | Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20212 [Bug 20212] Slowness in Receiving in Acquisitions -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 24455] Date formatting from JS
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24455 --- Comment #42 from Agustín Moyano --- (In reply to Martin Renvoize from comment #39) > I'm facing similar challenges here as I did with bug 24454. > > Now I'm wrapping my head around it, there seems to be a fair bit of > duplicate code introduced here that already exists in > koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc > > I'm by no means against introducing moment.js, I like the idea of using well > maintained and thought out third party libraries and the was of accessing > the functions written here is nice and elegant.. much like the way you > introduced elegant accessors for currency handling in bug 24454 (I'd like to > see some of those idea's taken forward too). > > But.. I don't like that we're duplicating logic and making it somewhat less > clear which functions should be used for the job so would like some form of > merge/aggregation of such functionality and a clear documentation somewhere > for how to use it before I'm happy pushing this. Hello Martin, functions in calendar.inc has similar logic, but they do the oposite job of this functions. calendar.inc function's inputs are date/datetime strings as specified by dateformat preference and returns a JS Date object. This function's inputs are date/datetime string as returned from the api (RFC3339) and returns a date/datetime/time string as specified by dateformat preference, and translated to corresponding timezone. -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 24455] Date formatting from JS
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24455 --- Comment #43 from Agustín Moyano --- (In reply to Agustín Moyano from comment #42) > (In reply to Martin Renvoize from comment #39) > > I'm facing similar challenges here as I did with bug 24454. > > > > Now I'm wrapping my head around it, there seems to be a fair bit of > > duplicate code introduced here that already exists in > > koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc > > > > I'm by no means against introducing moment.js, I like the idea of using well > > maintained and thought out third party libraries and the was of accessing > > the functions written here is nice and elegant.. much like the way you > > introduced elegant accessors for currency handling in bug 24454 (I'd like to > > see some of those idea's taken forward too). > > > > But.. I don't like that we're duplicating logic and making it somewhat less > > clear which functions should be used for the job so would like some form of > > merge/aggregation of such functionality and a clear documentation somewhere > > for how to use it before I'm happy pushing this. > > Hello Martin, functions in calendar.inc has similar logic, but they do the > oposite job of this functions. > > calendar.inc function's inputs are date/datetime strings as specified by > dateformat preference and returns a JS Date object. > > This function's inputs are date/datetime string as returned from the api > (RFC3339) and returns a date/datetime/time string as specified by dateformat > preference, and translated to corresponding timezone. I believe Calendar.inc functions are used to get a date from tt variable, and put that date into a jquery calendar input. This functions should be used to format dates from the api -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 24455] Date formatting from JS
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24455 --- Comment #44 from Agustín Moyano --- (In reply to Martin Renvoize from comment #40) > Examples on things that need clarifying.. > > 1) Is the intention to always pass in a 'String' (and if so, of what format) > to the new $date, $datetime and $time window functions.. or are you > deliberately allow Date prototypes to be passed? It was designed to transform dates from the api, so input is always RFC3339 > 2) You allow to pass in a timezone in the options, but the string value may > also include an offset if it's a RFC3339 so how are the two being ratified..? For example, if you pass the following value '2020-03-18T07:00:00-03:00' and you set the timezone for an equivalent of +03:00 the result of calling $datetime should be '2020-03-18T13:00:00+03:00' each one being equivalent to '2020-03-18T10:00:00Z' -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 24455] Date formatting from JS
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24455 --- Comment #45 from Martin Renvoize --- I'm looking to add a followup of my own here to clarify the situation.. struggled to put it into words when talking to Agustin so I'm going to let code speak ;) -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 24455] Date formatting from JS
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24455 Martin Renvoize changed: What|Removed |Added Attachment #100120|0 |1 is obsolete|| --- Comment #47 from Martin Renvoize --- Created attachment 101709 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=101709&action=edit Bug 24455: Add moment library in staff This patch adds koha-tmpl/intranet-tmpl/lib/moment/moment.min.js in order to use the moment library (https://momentjs.com/) Signed-off-by: Andrew Isherwood Signed-off-by: Kyle M Hall Signed-off-by: Martin Renvoize -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 24455] Date formatting from JS
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24455 Martin Renvoize changed: What|Removed |Added Attachment #100121|0 |1 is obsolete|| --- Comment #48 from Martin Renvoize --- Created attachment 101710 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=101710&action=edit Bug 24455: Add moment-timezone library in opac This patch adds koha-tmpl/opac-tmpl/bootstrap/lib/moment-timezone-with-data-10-year-range.min.js in order to use the moment library with timezones (https://momentjs.com/timezone/) Signed-off-by: Andrew Isherwood Signed-off-by: Kyle M Hall Signed-off-by: Martin Renvoize -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 24455] Date formatting from JS
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24455 Martin Renvoize changed: What|Removed |Added Attachment #100119|0 |1 is obsolete|| --- Comment #46 from Martin Renvoize --- Created attachment 101708 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=101708&action=edit Bug 24455: Add moment library in opac This patch adds koha-tmpl/opac-tmpl/bootstrap/lib/moment.min.js in order to use the moment library (https://momentjs.com/) Signed-off-by: Andrew Isherwood Signed-off-by: Kyle M Hall Signed-off-by: Martin Renvoize -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 24455] Date formatting from JS
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24455 Martin Renvoize changed: What|Removed |Added Attachment #100122|0 |1 is obsolete|| --- Comment #49 from Martin Renvoize --- Created attachment 101711 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=101711&action=edit Bug 24455: Add moment-timezone library in staff This patch adds koha-tmpl/intranet-tmpl/lib/moment/moment-timezone-with-data-10-year-range.min.js in order to use the moment library with timezones (https://momentjs.com/timezone/) Signed-off-by: Andrew Isherwood Signed-off-by: Kyle M Hall Signed-off-by: Martin Renvoize -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 24455] Date formatting from JS
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24455 Martin Renvoize changed: What|Removed |Added Attachment #100124|0 |1 is obsolete|| --- Comment #51 from Martin Renvoize --- Created attachment 101713 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=101713&action=edit Bug 24455: [DO NOT PUSH] test timezone This is just a test.. I added the .inc file to adimn's main page To test: 1. go to Koha main page and open chrome or firefox console 2. type $datetime('2020-02-18T12:46:05Z', {tz: 'America/Argentina/Buenos_Aires'}) and you should get "02/18/2020 09:46" because America/Argentina/Buenos_Aires is -03:00 3. type $datetime('2020-02-18T12:46:05Z', {tz: 'Asia/Shanghai'}) and you should get "02/18/2020 20:46" because Asia/Shanghai is +08:00 4. type $datetime('2020-02-18T12:46:05Z') and it should be translated to your koha instance configured timezone. Signed-off-by: Kyle M Hall Signed-off-by: Martin Renvoize -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 24455] Date formatting from JS
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24455 Martin Renvoize changed: What|Removed |Added Attachment #100123|0 |1 is obsolete|| --- Comment #50 from Martin Renvoize --- Created attachment 101712 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=101712&action=edit Bug 24455: Add JS functions to format date and datetime strings This patch adds the a js-date-format.inc file on each opac and staff interface (date-format.inc whas not available as name) When you include that file in your TT, you'll get the following functions available: 1. $date(raw_date_string, options) This function parses a date string, as produced by an api call, and returns the corresponding date formatted according to 'dateformat' and 'TimeFormat' parameters. For example: // dateformat: us // timeformat: 12hr // Timezone: UTC $date('2020-03-23T15:00:00+01:00') // You will get '03/23/2020' $date('2020-03-23T15:00:00+01:00', {withtime: true}) // You will get '03/23/2020 14:00' $date('2020-03-23T15:00:00+01:00', {withtime: true, tz: 'Europe/Paris'}) // You will get '03/23/2020 15:00+01:00' Options: * dateformat: override date format as configured in staff interface (accepts also 'rfc3339') * timeformat: override time format as configured in staff client (available options are '12hr' and '24hr') * withtime: also print the time part (default false) * tz: set the timezone 2. $datetime(raw_date_string, option) The same as $date but sets withtime to true 3. $time(raw_date_string, option) The same as $datetime but shows only the time part To test you must implement and test bug 20936, where it will be used Signed-off-by: Andrew Isherwood Signed-off-by: Kyle M Hall Signed-off-by: Martin Renvoize -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 24455] Date formatting from JS
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24455 Martin Renvoize changed: What|Removed |Added Attachment #100125|0 |1 is obsolete|| --- Comment #52 from Martin Renvoize --- Created attachment 101714 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=101714&action=edit Bug 24455: Add Moment.js to About page Signed-off-by: Kyle M Hall Signed-off-by: Martin Renvoize -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 24455] Date formatting from JS
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24455 --- Comment #53 from Martin Renvoize --- Created attachment 101715 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=101715&action=edit Bug 24455: (follow-up) Document function This patch just adds some minimal documentation to the main exported JS function. Signed-off-by: Martin Renvoize -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 24455] Date formatting from JS
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24455 Martin Renvoize changed: What|Removed |Added Status|Failed QA |Passed QA --- Comment #54 from Martin Renvoize --- Back to PQA.. I've added a followup which documents the main function. I'm happy to add moment.js as it's not a huge library and is pretty much the defacto library used in the wild for datetime manipulation. I still think it's somewhat unclear how Calendar.inc and this include differ from the end developers perspective and would love to see something akin to 'date_inputs.inc' and 'date_outputs.inc' to make it clear how the two relate to each other.. and perhaps even have some of the functionality shared. I'll try to work out some followup bugs for these parts however. -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 24455] Date formatting from JS
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24455 --- Comment #55 from Martin Renvoize --- Nice work everyone! Pushed to master for 20.05 -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 24455] Date formatting from JS
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24455 Martin Renvoize changed: What|Removed |Added Version(s)||20.05.00 released in|| Status|Passed QA |Pushed to master -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 24455] Date formatting from JS
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24455 Martin Renvoize changed: What|Removed |Added Text to go in the||This patchset lays the release notes||foundations for applying ||date formatting as ||described in the koha ||system preferences to ||datetimes returned by the ||API in RFC3339 format. -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 24455] Date formatting from JS
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24455 Agustín Moyano changed: What|Removed |Added Blocks||24980 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24980 [Bug 24980] Date formatting from JS - use timezone only with dates with offset -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 24455] Date formatting from JS
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24455 Martin Renvoize changed: What|Removed |Added Blocks||24987 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24987 [Bug 24987] Duplicate code in calendar.inc and js-date-format.inc -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 24455] Date formatting from JS
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24455 Joy Nelson changed: What|Removed |Added CC||j...@bywatersolutions.com --- Comment #56 from Joy Nelson --- enhancement not backported to 19.11.x -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 24455] date formatting from JS
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24455 Agustín Moyano changed: What|Removed |Added Blocks||20936 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20936 [Bug 20936] Holds History for patrons in OPAC -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 24455] date formatting from JS
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24455 Agustín Moyano changed: What|Removed |Added Patch complexity|--- |Small patch Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 24455] date formatting from JS
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24455 --- Comment #1 from Agustín Moyano --- Created attachment 97567 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=97567&action=edit Bug 24455: Add moment library in opac This patch adds koha-tmpl/opac-tmpl/bootstrap/lib/moment.min.js in order to use the moment library (https://momentjs.com/) -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 24455] date formatting from JS
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24455 --- Comment #2 from Agustín Moyano --- Created attachment 97568 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=97568&action=edit Bug 24455: Add moment-timezone library in opac This patch adds koha-tmpl/opac-tmpl/bootstrap/lib/moment-timezone-with-data-10-year-range.min.js in order to use the moment library with timezones (https://momentjs.com/timezone/) -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 24455] date formatting from JS
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24455 --- Comment #3 from Agustín Moyano --- Created attachment 97569 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=97569&action=edit Bug 24455: Add JS functions to format date and datetime strings This patch adds the koha-tmpl/opac-tmpl/bootstrap/en/includes/js-date-format.inc file (date-format.inc whas not available as name) When you include that file in your TT, you'll get the following functions available: 1. $date(raw_date_string, options) This function parses a date string, as produced by an api call, and returns the corresponding date formatted according to 'dateformat' and 'TimeFormat' parameters. For example: // dateformat: us // timeformat: 12hr // Timezone: UTC $date('2020-03-23T15:00:00+01:00') // You will get '03/23/2020' $date('2020-03-23T15:00:00+01:00', {withtime: true}) // You will get '03/23/2020 14:00' $date('2020-03-23T15:00:00+01:00', {withtime: true, tz: 'Europe/Paris'}) // You will get '03/23/2020 15:00+01:00' Options: * dateformat: override date format as configured in staff interface (accepts also 'rfc3339') * timeformat: override time format as configured in staff client (available options are '12hr' and '24hr') * withtime: also print the time part (default false) * tz: set the timezone 2. $datetime(raw_date_string, option) The same as $date but sets withtime to true 3. $time(raw_date_string, option) The same as $datetime but shows only the time part To test you must implement and test bug 20936, where it will be used -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 24455] date formatting from JS
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24455 Agustín Moyano changed: What|Removed |Added Attachment #97567|0 |1 is obsolete|| Attachment #97568|0 |1 is obsolete|| Attachment #97569|0 |1 is obsolete|| --- Comment #4 from Agustín Moyano --- Created attachment 97574 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=97574&action=edit Bug 24455: Add moment library in opac This patch adds koha-tmpl/opac-tmpl/bootstrap/lib/moment.min.js in order to use the moment library (https://momentjs.com/) -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 24455] date formatting from JS
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24455 --- Comment #6 from Agustín Moyano --- Created attachment 97576 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=97576&action=edit Bug 24455: Add moment-timezone library in opac This patch adds koha-tmpl/opac-tmpl/bootstrap/lib/moment-timezone-with-data-10-year-range.min.js in order to use the moment library with timezones (https://momentjs.com/timezone/) -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 24455] date formatting from JS
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24455 --- Comment #5 from Agustín Moyano --- Created attachment 97575 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=97575&action=edit Bug 24455: Add moment library in staff This patch adds koha-tmpl/intranet-tmpl/lib/moment/moment.min.js in order to use the moment library (https://momentjs.com/) -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 24455] date formatting from JS
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24455 --- Comment #7 from Agustín Moyano --- Created attachment 97577 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=97577&action=edit Bug 24455: Add moment-timezone library in staff This patch adds koha-tmpl/intranet-tmpl/lib/moment/moment-timezone-with-data-10-year-range.min.js in order to use the moment library with timezones (https://momentjs.com/timezone/) -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 24455] date formatting from JS
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24455 --- Comment #8 from Agustín Moyano --- Created attachment 97578 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=97578&action=edit Bug 24455: Add JS functions to format date and datetime strings This patch adds the a js-date-format.inc file on each opac and staff interface (date-format.inc whas not available as name) When you include that file in your TT, you'll get the following functions available: 1. $date(raw_date_string, options) This function parses a date string, as produced by an api call, and returns the corresponding date formatted according to 'dateformat' and 'TimeFormat' parameters. For example: // dateformat: us // timeformat: 12hr // Timezone: UTC $date('2020-03-23T15:00:00+01:00') // You will get '03/23/2020' $date('2020-03-23T15:00:00+01:00', {withtime: true}) // You will get '03/23/2020 14:00' $date('2020-03-23T15:00:00+01:00', {withtime: true, tz: 'Europe/Paris'}) // You will get '03/23/2020 15:00+01:00' Options: * dateformat: override date format as configured in staff interface (accepts also 'rfc3339') * timeformat: override time format as configured in staff client (available options are '12hr' and '24hr') * withtime: also print the time part (default false) * tz: set the timezone 2. $datetime(raw_date_string, option) The same as $date but sets withtime to true 3. $time(raw_date_string, option) The same as $datetime but shows only the time part To test you must implement and test bug 20936, where it will be used -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 24455] date formatting from JS
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24455 Tomás Cohen Arazi changed: What|Removed |Added CC||jonathan.dru...@bugs.koha-c ||ommunity.org -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/