-
Notifications
You must be signed in to change notification settings - Fork 4
Variable.formatDateTimeRange
connor-baer edited this page Nov 8, 2025
·
2 revisions
@sumup-oss/intl / formatDateTimeRange
constformatDateTimeRange: (startDate,endDate,locales?,options?) =>string
Defined in: lib/date-time-format/index.ts:260
Formats a datetime range with support for various date and time styles.
| Parameter | Type |
|---|---|
startDate |
FormattableDateTime |
endDate |
FormattableDateTime |
locales? |
string | string[] |
options? |
DateTimeFormatOptions |
string
import { formatDateTimeRange } from '@sumup-oss/intl';
const startDate = new Temporal.PlainDate(2000, 2, 1);
const endDate = new Temporal.PlainDate(2000, 2, 29);
formatDateTimeRange(startDate, endDate, 'de-DE');
// 01.–29.02.2000In runtimes that don't support the Intl.DateTimeFormat.formatRange API,
the start and end dates are localized individually and joined using an en dash.