diff options
Diffstat (limited to 'modern/src/settings/CalendarPage.jsx')
-rw-r--r-- | modern/src/settings/CalendarPage.jsx | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/modern/src/settings/CalendarPage.jsx b/modern/src/settings/CalendarPage.jsx index 2868d3d5..099858a3 100644 --- a/modern/src/settings/CalendarPage.jsx +++ b/modern/src/settings/CalendarPage.jsx @@ -1,4 +1,4 @@ -import moment from 'moment'; +import dayjs from 'dayjs'; import React, { useState } from 'react'; import { useDispatch } from 'react-redux'; import TextField from '@mui/material/TextField'; @@ -53,8 +53,8 @@ const simpleCalendar = () => window.btoa([ 'PRODID:-//Traccar//NONSGML Traccar//EN', 'BEGIN:VEVENT', 'UID:00000000-0000-0000-0000-000000000000', - `DTSTART;${formatCalendarTime(moment())}`, - `DTEND;${formatCalendarTime(moment().add(1, 'hours'))}`, + `DTSTART;${formatCalendarTime(dayjs())}`, + `DTEND;${formatCalendarTime(dayjs().add(1, 'hours'))}`, 'RRULE:FREQ=DAILY', 'SUMMARY:Event', 'END:VEVENT', @@ -148,18 +148,18 @@ const CalendarPage = () => { <TextField label={t('reportFrom')} type="datetime-local" - value={moment(lines[5].slice(-15)).locale('en').format(moment.HTML5_FMT.DATETIME_LOCAL)} + value={dayjs(lines[5].slice(-15)).locale('en').format('YYYY-MM-DDTHH:mm')} onChange={(e) => { - const time = formatCalendarTime(moment(e.target.value, moment.HTML5_FMT.DATETIME_LOCAL)); + const time = formatCalendarTime(dayjs(e.target.value, 'YYYY-MM-DDTHH:mm')); setItem({ ...item, data: updateCalendar(lines, 5, `DTSTART;${time}`) }); }} /> <TextField label={t('reportTo')} type="datetime-local" - value={moment(lines[6].slice(-15)).locale('en').format(moment.HTML5_FMT.DATETIME_LOCAL)} + value={dayjs(lines[6].slice(-15)).locale('en').format('YYYY-MM-DDTHH:mm')} onChange={(e) => { - const time = formatCalendarTime(moment(e.target.value, moment.HTML5_FMT.DATETIME_LOCAL)); + const time = formatCalendarTime(dayjs(e.target.value, 'YYYY-MM-DDTHH:mm')); setItem({ ...item, data: updateCalendar(lines, 6, `DTEND;${time}`) }); }} /> |