@zohodesk/library-platform 1.2.0-exp.2 → 1.2.0-exp.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -15,14 +15,18 @@ const DateFieldTranslator = _ref => {
15
15
  uiType,
16
16
  name
17
17
  } = field;
18
+ const defaultDateTimeFormat = {
19
+ dateFormat: 'dd MM yyyy',
20
+ timeFormat: '12-hour',
21
+ delimiter: 'space',
22
+ isShortenDateTimeInfo: false
23
+ };
18
24
  const {
19
25
  dateFormat,
20
26
  timeFormat,
21
27
  delimiter,
22
28
  isShortenDateTimeInfo
23
- } = context.dateTimeFormat; // const appContext = platformSDK.app.getContext();
24
- // const { dateFormat, timeFormat, delimiter } = appContext.dateTimeFormat;
25
-
29
+ } = context?.dateTimeFormat || defaultDateTimeFormat;
26
30
  const newDateValue = DateAndTimeFormat({
27
31
  dateFormatType: dateFormat,
28
32
  timeFormatType: timeFormat,
@@ -15,14 +15,18 @@ const DateTimeFieldTranslator = _ref => {
15
15
  uiType,
16
16
  name
17
17
  } = field;
18
+ const defaultDateTimeFormat = {
19
+ dateFormat: 'dd MM yyyy',
20
+ timeFormat: '12-hour',
21
+ delimiter: 'space',
22
+ isShortenDateTimeInfo: false
23
+ };
18
24
  const {
19
25
  dateFormat,
20
26
  timeFormat,
21
27
  delimiter,
22
28
  isShortenDateTimeInfo
23
- } = context.dateTimeFormat; // const appContext = platformSDK.app.getContext();
24
- // const { dateFormat, timeFormat, delimiter } = appContext.dateTimeFormat;
25
-
29
+ } = context?.dateTimeFormat || defaultDateTimeFormat;
26
30
  const newDateValue = DateAndTimeFormat({
27
31
  dateFormatType: dateFormat,
28
32
  timeFormatType: timeFormat,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zohodesk/library-platform",
3
- "version": "1.2.0-exp.2",
3
+ "version": "1.2.0-exp.3",
4
4
  "description": "",
5
5
  "main": "es/index.js",
6
6
  "files": [