Koha-clms/Koha/Template/Plugin
Agustin Moyano 8412c19c50
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 <andrew.isherwood@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-25 13:54:17 +00:00
..
Asset.pm Bug 22451: Make Asset plugin use Koha::version instead of version from db 2019-04-16 13:17:32 +00:00
AudioAlerts.pm Bug 11431: (QA followup) Move AudioAlerts to a separate plugin 2015-11-04 12:33:10 -03:00
AuthorisedValues.pm Bug 21503: Restore existing ternary operator logic 2020-03-24 11:30:08 +00:00
Biblio.pm Bug 14610 - Add and update modules 2016-10-26 12:15:13 +00:00
Branches.pm Bug 20443: Move C4::Members::AttributeTypes::GetAttributeTypes to Koha::Patron::Attribute::Types 2020-03-23 13:44:35 +00:00
Cache.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
Categories.pm Bug 21890: (QA follow-up) Use List::Util::any 2019-04-12 02:32:04 +00:00
CirculationRules.pm Bug 24026: (bug 22847 follow-up) Remove c/p issues 2019-11-13 13:49:04 +00:00
ColumnsSettings.pm Bug 10212: Columns configuration for tables 2014-08-26 09:28:03 -03:00
HtmlTags.pm Bug 18665 - Translatability: Add tt filter to allow html tags inside tt directives 2017-06-21 11:22:18 -03:00
I18N.pm Bug 24068: (RM follow-up) Enhance the POD 2019-11-22 14:57:46 +00:00
ItemTypes.pm Bug 17843: [QA Follow-up] Some polishing 2017-07-05 13:42:21 -03:00
Koha.pm Bug 18026: Correct URL to database columns from .pref files 2017-02-21 19:54:23 +00:00
KohaDates.pm Bug 24455: Add JS functions to format date and datetime strings 2020-03-25 13:54:17 +00:00
KohaNews.pm Bug 24745: (follow-up) Correct return statement in news plugin 2020-03-25 09:42:10 +00:00
KohaPlugins.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
KohaSpan.pm Bug 15707: (QA follow-up) Allow object names to be styled without impeding translation 2018-02-12 15:41:08 -03:00
Languages.pm Bug 18213: Add Template plugin and fix for C4/Languages 2019-03-28 15:57:32 +00:00
Price.pm Bug 4078: Pass with_symbol to module 2018-03-23 11:45:38 -03:00
Remove_MARC_punctuation.pm Bug 19578: Remove MARC punctuation in notices (TT syntax) 2018-04-04 15:45:43 -03:00
To.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
raw.pm Bug 13618: Add POD to raw.pm 2018-08-17 16:14:14 +00:00