Skip to content

Commit

Permalink
Added fullDay default duration for events
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacob-Daniel committed Oct 2, 2024
1 parent 34894d2 commit 4ef7602
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 1 deletion.
6 changes: 6 additions & 0 deletions admin/src/pages/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,12 @@ function Settings() {
defaultMessage: '2 Hours',
})}
</Option>
<Option value={1440}>

Check failure on line 301 in admin/src/pages/settings.js

View workflow job for this annotation

GitHub Actions / lint

Replace `↹↹↹↹↹` with `····················`
{formatMessage({

Check failure on line 302 in admin/src/pages/settings.js

View workflow job for this annotation

GitHub Actions / lint

Replace `↹↹↹↹↹` with `····················`
id: getTrad('view.settings.section.general.default-duration.fullday'),

Check failure on line 303 in admin/src/pages/settings.js

View workflow job for this annotation

GitHub Actions / lint

Replace `↹↹↹↹↹····` with `························`
defaultMessage: 'Full Day',

Check failure on line 304 in admin/src/pages/settings.js

View workflow job for this annotation

GitHub Actions / lint

Replace `↹↹↹↹↹` with `····················`
})}

Check failure on line 305 in admin/src/pages/settings.js

View workflow job for this annotation

GitHub Actions / lint

Replace `↹↹↹↹↹` with `····················`
</Option>

Check failure on line 306 in admin/src/pages/settings.js

View workflow job for this annotation

GitHub Actions / lint

Replace `↹↹↹↹↹</Option>····················` with `····················</Option>`
</Select>
</GridItem>
</Grid>
Expand Down
1 change: 1 addition & 0 deletions admin/src/translations/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"view.settings.section.general.default-duration.1h": "1 Stunde",
"view.settings.section.general.default-duration.1.5h": "1,5 Stunden",
"view.settings.section.general.default-duration.2h": "2 Stunden",
"view.settings.section.general.default-duration.fullDay": "Ganztägig",

Check failure on line 28 in admin/src/translations/de.json

View workflow job for this annotation

GitHub Actions / lint

Delete `··`
"view.settings.section.general.start.label": "Start-Feld auswählen",
"view.settings.section.general.end.label": "Ende-Feld auswählen",
"view.settings.section.general.end.none": "Kein Ende-Feld",
Expand Down
1 change: 1 addition & 0 deletions admin/src/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"view.settings.section.general.default-duration.1h": "1 Hour",
"view.settings.section.general.default-duration.1.5h": "1.5 Hours",
"view.settings.section.general.default-duration.2h": "2 Hours",
"view.settings.section.general.default-duration.fullDay": "Full Day",
"view.settings.section.general.start.label": "Choose your start field",
"view.settings.section.general.end.label": "Choose your end field",
"view.settings.section.general.end.none": "No end field",
Expand Down
1 change: 1 addition & 0 deletions admin/src/translations/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"view.settings.section.general.default-duration.1h": "1 hora",
"view.settings.section.general.default-duration.1.5h": "1,5 horas",
"view.settings.section.general.default-duration.2h": "2 horas",
"view.settings.section.general.default-duration.fullDay": "Todo el día",

Check failure on line 29 in admin/src/translations/es.json

View workflow job for this annotation

GitHub Actions / lint

Delete `··`
"view.settings.section.general.start.label": "Elija su campo de comienzo",
"view.settings.section.general.end.label": "Elija su campo de finalización",
"view.settings.section.general.end.none": "Sin campo de finalización",
Expand Down
4 changes: 3 additions & 1 deletion server/services/service.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ module.exports = () => ({
startDate: x[config.startField],
endDate: config.endField
? x[config.endField]
: moment(x[config.startField]).add(config.defaultDuration, 'minutes'),
: config.defaultDuration === 'fullDay'

Check failure on line 84 in server/services/service.js

View workflow job for this annotation

GitHub Actions / lint

Replace `·⏎·↹↹↹?·moment(x[config.startField]).endOf('day')·········` with `⏎········?·moment(x[config.startField]).endOf('day')`
? moment(x[config.startField]).endOf('day')
: moment(x[config.startField]).add(config.defaultDuration, 'minutes'),

Check failure on line 86 in server/services/service.js

View workflow job for this annotation

GitHub Actions / lint

Delete `↹`
color: config.colorField ? x[config.colorField] : null,
}));
},
Expand Down

0 comments on commit 4ef7602

Please sign in to comment.