File tree Expand file tree Collapse file tree 5 files changed +30
-9
lines changed
Expand file tree Collapse file tree 5 files changed +30
-9
lines changed Original file line number Diff line number Diff line change @@ -298,6 +298,12 @@ function Settings() {
298298 defaultMessage : '2 Hours' ,
299299 } ) }
300300 </ Option >
301+ < Option value = { 1440 } >
302+ { formatMessage ( {
303+ id : getTrad ( 'view.settings.section.general.default-duration.fullday' ) ,
304+ defaultMessage : 'Full Day' ,
305+ } ) }
306+ </ Option >
301307 </ Select >
302308 </ GridItem >
303309 </ Grid >
Original file line number Diff line number Diff line change 2525 "view.settings.section.general.default-duration.1h" : " 1 Stunde" ,
2626 "view.settings.section.general.default-duration.1.5h" : " 1,5 Stunden" ,
2727 "view.settings.section.general.default-duration.2h" : " 2 Stunden" ,
28+ "view.settings.section.general.default-duration.fullDay" : " Ganztägig" ,
2829 "view.settings.section.general.start.label" : " Start-Feld auswählen" ,
2930 "view.settings.section.general.end.label" : " Ende-Feld auswählen" ,
3031 "view.settings.section.general.end.none" : " Kein Ende-Feld" ,
Original file line number Diff line number Diff line change 2626 "view.settings.section.general.default-duration.1h" : " 1 Hour" ,
2727 "view.settings.section.general.default-duration.1.5h" : " 1.5 Hours" ,
2828 "view.settings.section.general.default-duration.2h" : " 2 Hours" ,
29+ "view.settings.section.general.default-duration.fullDay" : " Full Day" ,
2930 "view.settings.section.general.start.label" : " Choose your start field" ,
3031 "view.settings.section.general.end.label" : " Choose your end field" ,
3132 "view.settings.section.general.end.none" : " No end field" ,
Original file line number Diff line number Diff line change 2626 "view.settings.section.general.default-duration.1h" : " 1 hora" ,
2727 "view.settings.section.general.default-duration.1.5h" : " 1,5 horas" ,
2828 "view.settings.section.general.default-duration.2h" : " 2 horas" ,
29+ "view.settings.section.general.default-duration.fullDay" : " Todo el día" ,
2930 "view.settings.section.general.start.label" : " Elija su campo de comienzo" ,
3031 "view.settings.section.general.end.label" : " Elija su campo de finalización" ,
3132 "view.settings.section.general.end.none" : " Sin campo de finalización" ,
Original file line number Diff line number Diff line change @@ -74,16 +74,28 @@ module.exports = () => ({
7474 if ( config . drafts ) return true ;
7575 return x . publishedAt ;
7676 } ) ;
77-
78- return dataFiltered . map ( ( x ) => ( {
79- id : x . id ,
80- title : config . titleField ? x [ config . titleField ] : config . startField ,
81- startDate : x [ config . startField ] ,
82- endDate : config . endField
77+ return dataFiltered . map ( ( x ) => {
78+ let startDate = x [ config . startField ] ;
79+ let endDate = config . endField
8380 ? x [ config . endField ]
84- : moment ( x [ config . startField ] ) . add ( config . defaultDuration , 'minutes' ) ,
85- color : config . colorField ? x [ config . colorField ] : null ,
86- } ) ) ;
81+ : moment ( x [ config . startField ] ) . add ( config . defaultDuration , 'minutes' ) . format ( ) ;
82+
83+ const allDay = config . defaultDuration === 1440 ;
84+
85+ if ( allDay ) {
86+ startDate = moment ( startDate ) . startOf ( 'day' ) . format ( ) ;
87+ endDate = moment ( endDate ) . endOf ( 'day' ) . format ( ) ;
88+ }
89+
90+ return {
91+ id : x . id ,
92+ title : config . titleField ? x [ config . titleField ] : x [ config . startField ] ,
93+ startDate : startDate ,
94+ endDate : endDate ,
95+ color : config . colorField ? x [ config . colorField ] : null ,
96+ allDay : allDay ,
97+ } ;
98+ } ) ;
8799 } ,
88100 async getCollections ( ) {
89101 const types = strapi . contentTypes ;
You can’t perform that action at this time.
0 commit comments