@@ -13,7 +13,7 @@ import { ReadBalanceBehavior } from "../../Http/ReadBalanceBehavior";
1313import { throwError } from "../../Exceptions" ;
1414import { CONSTANTS } from "../../Constants" ;
1515import { TypeUtil } from "../../Utility/TypeUtil" ;
16- import { DateUtil } from "../../Utility/DateUtil" ;
16+ import { DateUtil , DateUtilOpts } from "../../Utility/DateUtil" ;
1717import { CasingConvention , ObjectUtil , ObjectChangeCaseOptions } from "../../Utility/ObjectUtil" ;
1818import { JsonSerializer } from "../../Mapping/Json/Serializer" ;
1919
@@ -71,6 +71,7 @@ export class DocumentConventions {
7171 private _remoteEntityFieldNameConvention : CasingConvention ;
7272
7373 private _objectMapper : TypesAwareObjectMapper ;
74+ private _dateUtil : DateUtil ;
7475
7576 private _useCompression ;
7677
@@ -116,16 +117,24 @@ export class DocumentConventions {
116117 } ) ;
117118
118119 this . _useCompression = null ;
120+
121+ this . _dateUtilOpts = { } ;
122+ this . _dateUtil = new DateUtil ( this . _dateUtilOpts ) ;
119123 }
120124
121125 public get objectMapper ( ) : TypesAwareObjectMapper {
122126 return this . _objectMapper ;
123127 }
124128
125129 public set objectMapper ( value : TypesAwareObjectMapper ) {
130+ this . _assertNotFrozen ( ) ;
126131 this . _objectMapper = value ;
127132 }
128133
134+ public get dateUtil ( ) : DateUtil {
135+ return this . _dateUtil ;
136+ }
137+
129138 public get readBalanceBehavior ( ) : ReadBalanceBehavior {
130139 return this . _readBalanceBehavior ;
131140 }
@@ -196,6 +205,26 @@ export class DocumentConventions {
196205 this . _useCompression = value ;
197206 }
198207
208+ private _dateUtilOpts : DateUtilOpts ;
209+
210+ public get storeDatesInUtc ( ) {
211+ return this . _dateUtilOpts . useUtcDates ;
212+ }
213+
214+ public set storeDatesInUtc ( value ) {
215+ this . _assertNotFrozen ( ) ;
216+ this . _dateUtilOpts . useUtcDates = value ;
217+ }
218+
219+ public get storeDatesWithTimezoneInfo ( ) {
220+ return this . _dateUtilOpts . withTimezone ;
221+ }
222+
223+ public set storeDatesWithTimezoneInfo ( value ) {
224+ this . _assertNotFrozen ( ) ;
225+ this . _dateUtilOpts . withTimezone = true ;
226+ }
227+
199228 /**
200229 * If set to 'true' then it will throw an exception when any query is performed (in session)
201230 * without explicit page size set.
0 commit comments