[Koha-bugs] [Bug 24980] Date formatting from JS - use timezone only with dates with offset

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Apr 30 14:09:17 CEST 2020


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24980

Jonathan Druart <jonathan.druart at bugs.koha-community.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #101910|0                           |1
        is obsolete|                            |
 Attachment #102157|0                           |1
        is obsolete|                            |

--- Comment #26 from Jonathan Druart <jonathan.druart at bugs.koha-community.org> ---
Created attachment 104025
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=104025&action=edit
Bug 24980: (RM follow-up) Only add timezone if passed a date-time

This patch prevents a timezone from being assigned to the js moment if
the input string is only at the full-date and not date-time resolution

To test:
1. Do not apply this patch
2. Set your system time zone to CET
3. Apply previous patch (It's just for test)
4. In your browser go to koha main page, open a console and type
$date('2020-03-25', {tz:
   'UTC'})
CHECK => you sould get '03/24/2020' (notice day is 24 instead of 25)
5. Apply this patch and reload the browser
6. repeat step 4
SUCCESS => now you get '03/25/2020' (day is correct)
7. Sing off

Signed-off-by: Martin Renvoize <martin.renvoize at ptfs-europe.com>
Signed-off-by: Agustin Moyano <agustinmoyano at theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart at bugs.koha-community.org>

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list