aboutsummaryrefslogtreecommitdiff
path: root/modern/src/settings/CalendarPage.jsx
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2023-09-04 10:53:05 -0700
committerAnton Tananaev <anton@traccar.org>2023-09-04 10:53:05 -0700
commit9a59d6524c45d5542433302a498f9ada4e45e806 (patch)
treeb779287db9104054ca5fbecf9f6218b2db46d8fe /modern/src/settings/CalendarPage.jsx
parent63eaa20047613c872979e2894fbdb5a0caab31f7 (diff)
downloadtrackermap-web-9a59d6524c45d5542433302a498f9ada4e45e806.tar.gz
trackermap-web-9a59d6524c45d5542433302a498f9ada4e45e806.tar.bz2
trackermap-web-9a59d6524c45d5542433302a498f9ada4e45e806.zip
Migrate to DayJs from moment
Diffstat (limited to 'modern/src/settings/CalendarPage.jsx')
-rw-r--r--modern/src/settings/CalendarPage.jsx14
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}`) });
}}
/>