@cdmx/wappler_ag_grid 0.6.9 → 0.7.0

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.
Files changed (2) hide show
  1. package/dmx-ag-grid.js +11 -19
  2. package/package.json +1 -1
package/dmx-ag-grid.js CHANGED
@@ -362,26 +362,18 @@ dmx.Component('ag-grid', {
362
362
  }
363
363
 
364
364
  function formatTime(params, timezone) {
365
- const date = new Date(params.value);
366
- if (!timezone) {
367
- timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
365
+ const date = new Date(params.value)
366
+ if (timezone) {
367
+ const options = {
368
+ timeZone: timezone,
369
+ };
370
+
371
+ const convertedTimestamp = date.toLocaleString('en-US', options);
372
+ dateTimezone = new Date(convertedTimestamp).getTime();
373
+ return formatDate(dateTimezone)
374
+ } else {
375
+ return formatDate(date);
368
376
  }
369
- const options = {
370
- timeZone: timezone,
371
- year: 'numeric',
372
- month: '2-digit',
373
- day: '2-digit',
374
- hour: 'numeric',
375
- minute: 'numeric',
376
- second: 'numeric',
377
- hour12: false,
378
- };
379
-
380
- const formatter = new Intl.DateTimeFormat(undefined, options);
381
- // const formattedDateTime = formatter.format(date);
382
- const formattedDateTime = date.toISOString()
383
- return formatDate(formattedDateTime)
384
-
385
377
  }
386
378
  dateFilterParams = {
387
379
  comparator: function (filterLocalDateAtMidnight, cellValue) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cdmx/wappler_ag_grid",
3
- "version": "0.6.9",
3
+ "version": "0.7.0",
4
4
  "type": "module",
5
5
  "description": "App Connect module for AG Grid Table Generation.",
6
6
  "license": "MIT",