question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[calendar] Parsing date in format yyyy-mm-ddT00:00:00 in Firefox

See original GitHub issue

Bug Report

On Firefox (I’m currently using the latest version 76.0.1), parsing a date such as 2018-08-13T00:00:00 results in August 13, 2000.

Steps to reproduce

See #935

  1. Using Firefox, supply the date in the format 2018-08-13T00:00:00 using set date

Expected result

August 13, 2018

Actual result

August 13, 2000

Testcase

https://jsfiddle.net/scblack/qzLvkxm9/1/

Additional Information

In the date parser, assuming text is ‘2018-08-13T00:00:00’.

It changes to lowercase with the following line:

text = ('' + text).trim().toLowerCase();

After this line, text is ‘2018-08-13t00:00:00’, which is then used to attempt to create a date:

var textDate = new Date(text);

After this, textDate is an invalid date. Firefox doesn’t seem to handle a lowercase ‘t’. when parsing the date.

Version

2.8.4

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:14 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
lubber-decommented, Aug 12, 2020

👀 Confirmed… (using browserstack) We’ll check this. In the meantime you can use “/” instead of “-” as a workaround, which works in Safari

$calendar.calendar('set date', '2020/08/12')

https://jsfiddle.net/rbsf72zc/

0reactions
lubber-decommented, Aug 18, 2020

@whsyu Your issue with safari is fixed by #1647 See https://jsfiddle.net/lubber/s82zoc5w/1/

Read more comments on GitHub >

github_iconTop Results From Across the Web

Date.parse() - JavaScript - MDN Web Docs
The Date.parse() method parses a string representation of a date, ... A string representing a simplification of the ISO 8601 calendar date extended...
Read more >
new Date() is working in Chrome but not Firefox - Stack Overflow
A string representing an RFC2822 or ISO 8601 date (other formats may be used, but results may be unexpected). So, when you want...
Read more >
Converting string to Datetime is showing Invalid Date error in ...
In my AngularJs application, I am getting the date in string format which I need to convert to datetime and show in a...
Read more >
Invalid Date issue in Safari and Firefox-moment.js
[Solved]-Could not parse date parameter: Invalid Date issue in Safari and Firefox-moment.js ... Issue was with the moment method to format the date....
Read more >
How to convert Date to DateTime format | Support Center
n oracle SQL - PRPC_READ_FROM_STREAM() function I am getting values in this format "yyyyMMddtHHmmss.SSS zzz". how to convert this into YYYY-DD- ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found