Describe the bug
Interval.toLocaleString fails for Mobile Safari 14.0.3 with the error:
TypeError: this.dtFormatter(e.start,n).dtf.formatRange is not a function. (In 'this.dtFormatter(e.start,n).dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())', 'this.dtFormatter(e.start,n).dtf.formatRange' is undefined)
To Reproduce
Use Interval.toLocaleString in Mobile Safari 14.0.3
Example code:
import { DateTime, Interval } from 'luxon';
Interval.fromDateTimes(
new Date('2023-11-10T00:00:00Z'),
new Date('2023-11-20T00:00:00Z')
).toLocaleString(DateTime.DATE_MED_WITH_WEEKDAY);
Actual vs Expected behavior
Actual: TypeError as described above
Expected: No error
Desktop (please complete the following information):
This is an issue with the documentation, Interval#toLocaleString requires the browser to support Intl.DateTimeFormat#formatRange. iOS Safari only supports this starting with version 14.5.
Describe the bug Interval.toLocaleString fails for Mobile Safari 14.0.3 with the error:
TypeError: this.dtFormatter(e.start,n).dtf.formatRange is not a function. (In 'this.dtFormatter(e.start,n).dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())', 'this.dtFormatter(e.start,n).dtf.formatRange' is undefined)
To Reproduce Use Interval.toLocaleString in Mobile Safari 14.0.3 Example code:
Actual vs Expected behavior Actual: TypeError as described above Expected: No error
Desktop (please complete the following information):
Additional context