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.

Make parser more lenient for date-time values (invalid date-time value: "2015-08-12T::")

See original GitHub issue

I get the Error Uncaught Error: invalid date-time value: “2015-08-12T::”

error

in line

if(iCalEvent.startDate)

the ical file:

BEGIN:VCALENDAR
VERSION:2.0
METHOD:PUBLISH
BEGIN:VEVENT
UID:45574333
SUMMARY:ERANOS-Ensemble für Alte Musik - Arbeitswoche
DESCRIPTION:Ltg.: Prof. Frank Löhr Anmeldung für interessierte Zuhörer unter: info@musikfreunde.org 

(Veranstalter: Gesellschaft der Musikfreunde Marienmünster)
LOCATION:Marienmünster
CLASS:PUBLIC
DTSTART:20150812
DTEND:20150814
DTSTAMP:20150813T131400Z
END:VEVENT
END:VCALENDAR

Outlook read this file as an all day event from 12.08.2015 to 14.08.2015.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:1
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
fbackercommented, Apr 5, 2016

change in ical.js line 5587

if (aValue.length < 19) {
    if(aValue.length == 13){ // No time "2017-01-01T::"
        var time = new ICAL.Time({
            year: ICAL.helpers.strictParseInt(aValue.substr(0, 4)),
            month: ICAL.helpers.strictParseInt(aValue.substr(5, 2)),
            day: ICAL.helpers.strictParseInt(aValue.substr(8, 2)),
            hour: 0,
            minute: 0,
            second: 0,
            timezone: "Z"
        });
        return time;
    }
  throw new Error(
    'invalid date-time value: "' + aValue + '"'
  );
}
2reactions
kewischcommented, Oct 23, 2019

I’m working on a new patch that will make DATE, DATE-TIME, and PERIOD values more lenient when setting a specific flag for the parser. I’m pretty far through, just need to do some clean up, make sure I’m happy with the level of leniency, and check if there are other properties that might need similar treatment.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Make parser more lenient for date-time values (invalid date ...
The problem is that the DTSTART and DTEND in your ics data uses the default value type ( DATE-TIME ), since it does...
Read more >
Java 8 LocalDateTime is parsing invalid date - Stack Overflow
You just need a strict ResolverStyle . Parsing a text string occurs in two phases. Phase 1 is a basic text parse according...
Read more >
datetime — Basic date and time types — Python 3.11.1 ...
Returns a string representation of the timedelta object as a constructor call with canonical attribute values. Notes: This is exact but may overflow....
Read more >
DateFormat (Java Platform SE 7 ) - Oracle Help Center
Specify whether or not date/time parsing is to be lenient. void, setNumberFormat(NumberFormat newNumberFormat). Allows you to set the number formatter. void ...
Read more >
RangeError: invalid date - JavaScript - MDN Web Docs
The JavaScript exception "invalid date" occurs when a string leading to an invalid date has been provided to Date or Date.parse().
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