Bugzilla – Attachment 104026 Details for
Bug 24980
Date formatting from JS - use timezone only with dates with offset
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24980: (follow-up) return '' when date is null
Bug-24980-follow-up-return--when-date-is-null.patch (text/plain), 2.29 KB, created by
Jonathan Druart
on 2020-04-30 12:09:20 UTC
(
hide
)
Description:
Bug 24980: (follow-up) return '' when date is null
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2020-04-30 12:09:20 UTC
Size:
2.29 KB
patch
obsolete
>From c820c3d1f22bfe15258a58bc525725eab2f35afa Mon Sep 17 00:00:00 2001 >From: Agustin Moyano <agustinmoyano@theke.io> >Date: Tue, 31 Mar 2020 17:56:22 -0300 >Subject: [PATCH] Bug 24980: (follow-up) return '' when date is null > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > koha-tmpl/intranet-tmpl/prog/en/includes/js-date-format.inc | 2 ++ > koha-tmpl/opac-tmpl/bootstrap/en/includes/js-date-format.inc | 2 ++ > 2 files changed, 4 insertions(+) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/js-date-format.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/js-date-format.inc >index 64c8e8f2e2..3dae094b8d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/js-date-format.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/js-date-format.inc >@@ -32,6 +32,7 @@ > * as well as a 'withtime' boolean denoting whether to include time or not in the output string. > */ > window.$date = function(value, options) { >+ if(!value) return ''; > var tz = (options&&options.tz)||def_tz; > var m = moment(value); > if((m.creationData().format !== 'YYYY-MM-DD')&&tz) m.tz(tz); >@@ -55,6 +56,7 @@ > }; > > window.$time = function(value, options) { >+ if(!value) return ''; > var tz = (opitons&&options.tz)||def_tz; > var m = moment(value); > if(tz) m.tz(tz); >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/js-date-format.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/js-date-format.inc >index 21301d75bc..643cda065b 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/js-date-format.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/js-date-format.inc >@@ -31,6 +31,7 @@ > * as well as a 'withtime' boolean denoting whether to include time or not in the output string. > */ > window.$date = function(value, options) { >+ if(!value) return ''; > var tz = (options&&options.tz)||def_tz; > var m = moment(value); > if((m.creationData().format !== 'YYYY-MM-DD')&&tz) m.tz(tz); >@@ -54,6 +55,7 @@ > }; > > window.$time = function(value, options) { >+ if(!value) return ''; > var tz = (opitons&&options.tz)||def_tz; > var m = moment(value); > if(tz) m.tz(tz); >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 24980
:
101794
|
101909
|
101910
|
102157
|
104025
| 104026