Koha/koha-tmpl/intranet-tmpl/prog/en/includes
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
..
catalogue Bug 18433: Add missing filter 2020-02-19 16:07:58 +00:00
csv_headers
mana
modals
str Bug 8643: Add important constraint to marc subfields 2020-02-11 14:33:29 +00:00
virtualshelves/merge
about-team.inc Bug 24402: About template corrections 2020-03-16 11:01:35 +00:00
accounts.inc Bug 24592: Reword LOST_RETURN to LOST_FOUND 2020-02-13 15:58:49 +00:00
acquisitions-add-to-basket.inc
acquisitions-menu.inc
acquisitions-search.inc
acquisitions-toolbar.inc
additem.js.inc
additional-fields-display.inc
additional-fields-entry.inc
admin-items-search-field-form.inc
admin-menu.inc Bug 13881: Add desk management 2020-03-25 09:19:15 +00:00
adv-search.inc
auth-finder-search.inc
authorities-search-results.inc
authorities-search.inc
authorities-toolbar.inc
authorities.inc
authorities_js.inc
av-build-dropbox.inc
biblio-default-view.inc
biblio-title-head.inc
biblio-title.inc
biblio-view-menu.inc
blocked-fines.inc
blocking_errors.inc
borrower_debarments.inc
branch-selector.inc
budgets-active-currency.inc
budgets-admin-search.inc
budgets-admin-toolbar.inc
calendar.inc Bug 23268: Make "Suspend all holds" calendar select a date from tomorrow 2020-03-10 15:20:19 +00:00
cat-menu.inc
cat-search.inc
cat-toolbar.inc Bug 8595: Rename 'host item' to 'host record' 2020-03-20 15:35:15 +00:00
catalog-strings.inc
cataloging-search.inc
cateditor-ui.inc Bug 24789: [follow-up] Fix saving of macros 2020-03-16 15:08:36 +00:00
cateditor-widgets-marc21.inc
category-out-of-age-limit.inc
chart.inc
checkin-search.inc
checkouts-table-footer.inc
checkouts-table.inc
circ-menu.inc Bug 20443: Remove UpdateBorrowerAttribute and SetBorrowerAttributes 2020-03-23 13:44:16 +00:00
circ-nav.inc Bug 24837: Rename selectbranchprinter.pl to set-library.pl 2020-03-24 11:07:22 +00:00
circ-patron-search-results.inc Bug 24627: Correct style of clubs search results during hold process 2020-03-16 10:59:28 +00:00
circ-search.inc
cities-admin-search.inc
clubs-table.inc Bug 24627: Correct style of clubs search results during hold process 2020-03-16 10:59:28 +00:00
columns_settings.inc
contracts-admin-search.inc
country-list.inc
currencies-admin-search.inc
datatables.inc Bug 24662: Remove global variables MSG_* from datatables.inc 2020-03-11 13:49:15 +00:00
date-format.inc
delimiter_text.inc
desks-admin-search.inc Bug 13881: Add desk management 2020-03-25 09:19:15 +00:00
doc-head-close-receipt.inc
doc-head-close.inc Bug 24661: (RM follow-up) Check lang is defined 2020-02-25 14:28:54 +00:00
doc-head-open.inc Bug 24732: Set DumpTemplateVars Dumper options for Indent and Sort 2020-03-02 10:08:31 +00:00
empty_line.inc
facets.inc
filter-orders.inc
form-blocks.inc
format_price.inc
greybox.inc
guided-reports-view.inc
header.inc Bug 24837: Rename selectbranchprinter.pl to set-library.pl 2020-03-24 11:07:22 +00:00
holds_table.inc Bug 24802: Updating holds can cause suspensions to apply to wrong hold 2020-03-06 09:56:40 +00:00
home-search.inc
html_helpers.inc
i18n.inc
ill-list-table-strings.inc
ill-list-table.inc
ill-toolbar.inc
installer-doc-head-close.inc
installer-intranet-bottom.inc
installer-strings.inc
intranet-bottom.inc
intranetstylesheet.inc
js-date-format.inc Bug 24455: Add JS functions to format date and datetime strings 2020-03-25 13:54:17 +00:00
js_includes.inc
keyboard_shortcuts.inc
labels-toolbar.inc
langmenu-staff-top.inc
last-borrower.inc
letters-search.inc
member-alt-address-style-de.inc
member-alt-address-style-fr.inc
member-alt-address-style-us.inc
member-alt-contact-style-de.inc
member-alt-contact-style-fr.inc
member-alt-contact-style-us.inc
member-display-address-style-de.inc
member-display-address-style-fr.inc
member-display-address-style-us.inc
member-display-alt-address-style-de.inc
member-display-alt-address-style-fr.inc
member-display-alt-address-style-us.inc
member-main-address-style-de.inc
member-main-address-style-fr.inc
member-main-address-style-us.inc
members-toolbar.inc Bug 24776: Remove Borrowers.HasOverdues call 2020-03-16 14:52:07 +00:00
merge-record-strings.inc
merge-record.inc
messaging-preference-form.inc
noadd-warnings.inc
onboarding_messages.inc
page-numbers.inc
password_check.inc
patron-article-requests.inc
patron-return-claims.inc
patron-search-box.inc
patron-search.inc Bug 17374: (follow-up) Remove spaces from include file 2020-03-10 15:18:29 +00:00
patron-title.inc Bug 24514: Add option to exclude title from patron-title.inc 2020-02-19 11:18:15 +00:00
patron-toolbar.inc
patroncards-errors.inc Bug 24837: Rename selectbranchprinter.pl to set-library.pl 2020-03-24 11:07:22 +00:00
patroncards-toolbar.inc
patronfields.inc Bug 17374: (QA follow-up) Make search labels match with patron record 2020-03-10 15:18:29 +00:00
patrons-admin-search.inc
payments.inc
permissions.inc Bug 24846: Add new permission batch_extend_due_dates 2020-03-19 08:56:37 +00:00
popup-bottom.inc
pos-menu.inc Bug 24492: Add branch details page 2020-03-05 13:04:58 +00:00
prefs-admin-search.inc
prefs-menu.inc
quotes-toolbar.inc
quotes-upload-toolbar.inc
relatives-issues-table.inc
renew_results.inc Bug 23051: (QA follow-up) Missing curly and tabs and fix test 2020-03-06 10:03:41 +00:00
renew_strings.inc Bug 23051: (follow-up) Add renewal feedback and move code to subroutines and test 2020-03-06 10:03:34 +00:00
reports-menu.inc
reports-toolbar.inc
resort_form.inc
rotating-collections-toolbar.inc
search_indexes.inc
select2.inc
serials-menu.inc
serials-search.inc
serials-toolbar.inc
slip-print.inc
stockrotation-toolbar.inc
strings.inc
subscriptions-search.inc
subtypes_unimarc.inc
suggestions-add-search.inc
timepicker.inc
tools-item-action.inc
tools-menu.inc Bug 24846: Link to the new tool 2020-03-19 08:56:38 +00:00
tools-nomatch-action.inc Bug 23236: Remove 'its items may still be processed' in action if no match is found 2020-03-18 08:41:35 +00:00
tools-overlay-action.inc
validator-strings.inc
vendor-menu.inc
virtualshelves-toolbar.inc
waiting_holds.inc Bug 24514: Add option to exclude title from patron-title.inc 2020-02-19 11:18:15 +00:00
wysiwyg-systempreferences.inc
xslt-handler.inc
z3950-admin-search.inc
z3950_search.inc