File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed
Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -31,13 +31,12 @@ export function formatSwepActivePeriod(swepData: ISwepBanner): string {
3131 const fromString = activeFrom . toLocaleDateString ( 'en-GB' , formatOptions ) ;
3232 const untilString = activeUntil . toLocaleDateString ( 'en-GB' , formatOptions ) ;
3333
34- if ( now < activeFrom ) {
35- return `SWEP will be active from ${ fromString } until ${ untilString } ` ;
36- } else if ( now > activeUntil ) {
37- return `SWEP was active from ${ fromString } until ${ untilString } ` ;
38- } else {
39- return `SWEP is currently active from ${ fromString } until ${ untilString } ` ;
40- }
34+ return `SWEP is currently active from ${ fromString } until ${ untilString } ` ;
35+ } else if ( swepData . SwepActiveFrom && ! swepData . SwepActiveUntil ) {
36+ const activeFrom = new Date ( swepData . SwepActiveFrom ) ;
37+ const fromString = activeFrom . toLocaleDateString ( 'en-GB' , formatOptions ) ;
38+
39+ return `SWEP is currently active from ${ fromString } ` ;
4140 } else {
4241 return 'Active period not specified' ;
4342 }
You can’t perform that action at this time.
0 commit comments