aboutsummaryrefslogtreecommitdiff
path: root/modern/src/settings/CalendarPage.js
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2023-07-23 07:47:45 -0700
committerAnton Tananaev <anton@traccar.org>2023-07-23 07:47:45 -0700
commit56ec73d4d3483f6fe1ca26769cd2d8e8a6cc4ea5 (patch)
tree1a00318ebccbbf47ac9df2c1ff7beec176ec6c88 /modern/src/settings/CalendarPage.js
parent5f6d01e7c212b5adb455a68cda864a3ab65e939e (diff)
downloadtrackermap-web-56ec73d4d3483f6fe1ca26769cd2d8e8a6cc4ea5.tar.gz
trackermap-web-56ec73d4d3483f6fe1ca26769cd2d8e8a6cc4ea5.tar.bz2
trackermap-web-56ec73d4d3483f6fe1ca26769cd2d8e8a6cc4ea5.zip
Fix calendar parsing
Diffstat (limited to 'modern/src/settings/CalendarPage.js')
-rw-r--r--modern/src/settings/CalendarPage.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/modern/src/settings/CalendarPage.js b/modern/src/settings/CalendarPage.js
index 5ceb72d0..2868d3d5 100644
--- a/modern/src/settings/CalendarPage.js
+++ b/modern/src/settings/CalendarPage.js
@@ -22,8 +22,11 @@ const formatCalendarTime = (time) => {
};
const parseRule = (rule) => {
+ if (rule.endsWith('COUNT=1')) {
+ return { frequency: 'ONCE' };
+ }
const fragments = rule.split(';');
- const frequency = fragments[0].includes('FREQ') ? fragments[0].substring(11) : 'ONCE';
+ const frequency = fragments[0].substring(11);
const by = fragments.length > 1 ? fragments[1].split('=')[1].split(',') : null;
return { frequency, by };
};