File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -301,6 +301,11 @@ export class DocumentConventions {
301301 return this . _dateUtil ;
302302 }
303303
304+ public set dateUtil ( value : DateUtil ) {
305+ this . _assertNotFrozen ( ) ;
306+ this . _dateUtil = value ;
307+ }
308+
304309 public get readBalanceBehavior ( ) : ReadBalanceBehavior {
305310 return this . _readBalanceBehavior ;
306311 }
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ export class DateUtil {
1515
1616 public static utc : DateUtil = new DateUtil ( { useUtcDates : true } ) ;
1717
18- public constructor ( private _opts : DateUtilOpts ) { }
18+ public constructor ( protected opts : DateUtilOpts ) { }
1919
2020 public static timestamp ( ) : number {
2121 return moment ( ) . unix ( ) ;
@@ -35,7 +35,7 @@ export class DateUtil {
3535 }
3636
3737 let parsed ;
38- if ( this . _opts . useUtcDates || this . _opts . withTimezone || dateString . endsWith ( "Z" ) ) {
38+ if ( this . opts . useUtcDates || this . opts . withTimezone || dateString . endsWith ( "Z" ) ) {
3939 parsed = moment . parseZone ( dateString , DateUtil . DEFAULT_DATE_TZ_FORMAT ) ;
4040 } else {
4141 parsed = moment ( dateString , DateUtil . DEFAULT_DATE_FORMAT ) ;
@@ -50,15 +50,15 @@ export class DateUtil {
5050
5151 public stringify ( date : Date ) : string {
5252 const m = moment ( date ) ;
53- if ( this . _opts . useUtcDates ) {
53+ if ( this . opts . useUtcDates ) {
5454 m . utc ( ) ;
5555 }
5656
57- const format = this . _opts . withTimezone
57+ const format = this . opts . withTimezone
5858 ? DateUtil . DEFAULT_DATE_TZ_FORMAT
5959 : DateUtil . DEFAULT_DATE_FORMAT ;
6060 const result = m . format ( format ) ;
61- if ( this . _opts . useUtcDates && ! this . _opts . withTimezone ) {
61+ if ( this . opts . useUtcDates && ! this . opts . withTimezone ) {
6262 return result + "Z" ;
6363 }
6464
You can’t perform that action at this time.
0 commit comments