chayns-api 2.4.24 → 2.4.25

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.
@@ -621,6 +621,14 @@ class AppWrapper {
621
621
  }, {
622
622
  awaitResult: true
623
623
  }).then(result => {
624
+ if (config.type === _IChaynsReact.DialogType.DATE) {
625
+ const dialogResult = result.result;
626
+ if (typeof dialogResult === 'string') {
627
+ result.result = new Date(dialogResult);
628
+ } else if (Array.isArray(dialogResult)) {
629
+ result.result = dialogResult.map(date => new Date(date));
630
+ }
631
+ }
624
632
  callback(result);
625
633
  });
626
634
  return currentDialogId;
@@ -7,7 +7,7 @@ import { sendMessageToGroup, sendMessageToPage, sendMessageToUser } from '../cal
7
7
  import { DeviceLanguage } from '../constants/languages';
8
8
  import DialogHandler from '../handler/DialogHandler';
9
9
  import { addApiListener, dispatchApiEvent, removeApiListener } from '../helper/apiListenerHelper';
10
- import { AppName, DialogButtonType, Environment, Font, Gender, IconType, LoginState, RuntimeEnviroment, TappEvent } from '../types/IChaynsReact';
10
+ import { AppName, DialogButtonType, DialogType, Environment, Font, Gender, IconType, LoginState, RuntimeEnviroment, TappEvent } from '../types/IChaynsReact';
11
11
  import invokeAppCall from '../util/appCall';
12
12
  import { addAppStorageListener, clearAppStorage, isAppStorageAvailable, setAppStorageItem } from '../util/appStorage';
13
13
  import getDeviceInfo, { getScreenSize } from '../util/deviceHelper';
@@ -588,6 +588,14 @@ export class AppWrapper {
588
588
  }, {
589
589
  awaitResult: true
590
590
  }).then(result => {
591
+ if (config.type === DialogType.DATE) {
592
+ const dialogResult = result.result;
593
+ if (typeof dialogResult === 'string') {
594
+ result.result = new Date(dialogResult);
595
+ } else if (Array.isArray(dialogResult)) {
596
+ result.result = dialogResult.map(date => new Date(date));
597
+ }
598
+ }
591
599
  callback(result);
592
600
  });
593
601
  return currentDialogId;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chayns-api",
3
- "version": "2.4.24",
3
+ "version": "2.4.25",
4
4
  "description": "new chayns api",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",