@@ -17,14 +17,14 @@ export module DateSpecification {
17
17
export function generateLabel ( date : DateSpecification , timezone : string , timeSuffix : string ,
18
18
locale : string ) : string {
19
19
20
- let result : string = getValueLabel ( date . value , timezone , timeSuffix , locale ) ;
21
- if ( date . endValue ) result += ' - ' + getValueLabel ( date . endValue , timezone , timeSuffix , locale ) ;
20
+ let result : string = getValueLabel ( date . value , timezone , timeSuffix , locale , ! date . endValue ) ;
21
+ if ( date . endValue ) result += ' - ' + getValueLabel ( date . endValue , timezone , timeSuffix , locale , true ) ;
22
22
23
23
return result ;
24
24
}
25
25
26
26
27
- function getValueLabel ( value : string , timezone : string , timeSuffix : string , locale : string ) : string {
27
+ function getValueLabel ( value : string , timezone : string , timeSuffix : string , locale : string , addTimezoneInfo : boolean ) : string {
28
28
29
29
const hasTimeValue : boolean = value . includes ( ':' ) ;
30
30
const date : Date = parseDate ( value ) ;
@@ -33,7 +33,7 @@ export module DateSpecification {
33
33
// If the time suffix is set to '.', this indicates that no time suffix should be used
34
34
if ( hasTimeValue && timeSuffix !== '.' ) formattedDate = formattedDate + ' ' + timeSuffix ;
35
35
36
- if ( hasTimeValue ) formattedDate += ' (' + timezone + ')' ;
36
+ if ( addTimezoneInfo && hasTimeValue ) formattedDate += ' (' + timezone + ')' ;
37
37
38
38
return formattedDate ;
39
39
}
0 commit comments