@qrvey/utils 1.9.0 → 1.10.0-1

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 (285) hide show
  1. package/dist/charts/adapters/endpointData.js +0 -3
  2. package/dist/charts/interfaces/IAggregateAbbreviation.d.ts +1 -1
  3. package/dist/charts/interfaces/IAggregateLabel.d.ts +1 -1
  4. package/dist/charts/interfaces/IAggregateType.d.ts +1 -1
  5. package/dist/charts/interfaces/IRequestAdapterMetric.d.ts +12 -12
  6. package/dist/cjs/charts/adapters/endpointData.js +0 -3
  7. package/dist/cjs/charts/interfaces/IAggregateAbbreviation.d.ts +1 -1
  8. package/dist/cjs/charts/interfaces/IAggregateLabel.d.ts +1 -1
  9. package/dist/cjs/charts/interfaces/IAggregateType.d.ts +1 -1
  10. package/dist/cjs/charts/interfaces/IRequestAdapterMetric.d.ts +12 -12
  11. package/dist/cjs/column_format/interfaces/IChartGroupType.d.ts +1 -1
  12. package/dist/cjs/column_format/interfaces/IChartShelfType.d.ts +1 -1
  13. package/dist/cjs/column_format/interfaces/IChartTableType.d.ts +1 -1
  14. package/dist/cjs/column_format/interfaces/IColumnFormatReturnType.d.ts +1 -1
  15. package/dist/cjs/column_format/interfaces/IFormatStringType.d.ts +1 -1
  16. package/dist/cjs/columns/interfaces/IColumnImageUploadOption.d.ts +1 -1
  17. package/dist/cjs/columns/interfaces/IColumnPropertyType.d.ts +1 -1
  18. package/dist/cjs/columns/interfaces/IColumnType.d.ts +1 -1
  19. package/dist/cjs/columns/interfaces/IComplexColumnPropertyType.d.ts +1 -1
  20. package/dist/cjs/columns/interfaces/IComplexColumnType.d.ts +1 -1
  21. package/dist/cjs/columns/interfaces/ICompoundColumnPropertyType.d.ts +1 -1
  22. package/dist/cjs/columns/interfaces/ICompoundColumnType.d.ts +1 -1
  23. package/dist/cjs/columns/interfaces/IDateColumnPropertyType.d.ts +1 -1
  24. package/dist/cjs/columns/interfaces/INumericalColumnType.d.ts +1 -1
  25. package/dist/cjs/dates/adapters/ISOToNumericOffset.d.ts +6 -0
  26. package/dist/cjs/dates/adapters/ISOToNumericOffset.js +21 -0
  27. package/dist/cjs/dates/adapters/index.d.ts +2 -0
  28. package/dist/cjs/dates/adapters/index.js +2 -0
  29. package/dist/cjs/dates/adapters/numericOffsetToISO.d.ts +6 -0
  30. package/dist/cjs/dates/adapters/numericOffsetToISO.js +29 -0
  31. package/dist/cjs/dates/constants/ISO_8601_REGEX.d.ts +1 -0
  32. package/dist/cjs/dates/constants/ISO_8601_REGEX.js +4 -0
  33. package/dist/cjs/dates/constants/TIMEZONE_TYPE.d.ts +5 -0
  34. package/dist/cjs/dates/constants/TIMEZONE_TYPE.js +9 -0
  35. package/dist/cjs/dates/constants/index.d.ts +1 -0
  36. package/dist/cjs/dates/constants/index.js +1 -0
  37. package/dist/cjs/dates/helpers/getDateByTimezone.d.ts +8 -0
  38. package/dist/cjs/dates/helpers/getDateByTimezone.js +41 -0
  39. package/dist/cjs/dates/helpers/getDateByTimezoneOffset.d.ts +7 -0
  40. package/dist/cjs/dates/helpers/getDateByTimezoneOffset.js +22 -0
  41. package/dist/cjs/dates/helpers/getTimezoneObject.d.ts +10 -0
  42. package/dist/cjs/dates/helpers/getTimezoneObject.js +21 -0
  43. package/dist/cjs/dates/helpers/getTimezoneOffsetByType.d.ts +13 -0
  44. package/dist/cjs/dates/helpers/getTimezoneOffsetByType.js +27 -0
  45. package/dist/cjs/dates/helpers/index.d.ts +4 -1
  46. package/dist/cjs/dates/helpers/index.js +4 -1
  47. package/dist/cjs/dates/helpers/isValidISOOffset.d.ts +7 -0
  48. package/dist/cjs/dates/helpers/isValidISOOffset.js +17 -0
  49. package/dist/cjs/dates/interfaces/IBTimezone.d.ts +7 -0
  50. package/dist/cjs/dates/interfaces/IBTimezone.js +2 -0
  51. package/dist/cjs/dates/interfaces/IBTimezoneType.d.ts +2 -0
  52. package/dist/cjs/dates/interfaces/IBTimezoneType.js +2 -0
  53. package/dist/cjs/dates/interfaces/IDTimezone.d.ts +6 -0
  54. package/dist/cjs/dates/interfaces/IDTimezone.js +2 -0
  55. package/dist/cjs/dates/interfaces/IDTimezoneOffset.d.ts +1 -0
  56. package/dist/cjs/dates/interfaces/IDTimezoneOffset.js +2 -0
  57. package/dist/cjs/dates/interfaces/IDTimezoneType.d.ts +2 -0
  58. package/dist/cjs/dates/interfaces/IDTimezoneType.js +2 -0
  59. package/dist/cjs/dates/interfaces/IDateFormat.d.ts +1 -1
  60. package/dist/cjs/dates/interfaces/IDateGroupingProperty.d.ts +1 -1
  61. package/dist/cjs/dates/interfaces/IGetDateByTimezoneSettings.d.ts +6 -0
  62. package/dist/cjs/dates/interfaces/IGetDateByTimezoneSettings.js +2 -0
  63. package/dist/cjs/dates/interfaces/index.d.ts +6 -0
  64. package/dist/cjs/dates/interfaces/index.js +6 -0
  65. package/dist/cjs/dates/relative/helpers/parseDate.d.ts +2 -2
  66. package/dist/cjs/dates/relative/interfaces/IRelativeUnit.d.ts +1 -1
  67. package/dist/cjs/dates/relative/interfaces/RelativeCursor.d.ts +1 -1
  68. package/dist/cjs/dates/relative/interfaces/RelativeInput.d.ts +1 -1
  69. package/dist/cjs/dates/relative/interfaces/ui/IRelativeSectionMode.d.ts +1 -1
  70. package/dist/cjs/filters/helpers/builder/getFilterBuilderGeneralConfig.js +1 -1
  71. package/dist/cjs/filters/helpers/common/excludeFiltersByParams.js +5 -5
  72. package/dist/cjs/filters/helpers/common/getFiltersByTimezone.d.ts +10 -0
  73. package/dist/cjs/filters/helpers/common/getFiltersByTimezone.js +26 -0
  74. package/dist/cjs/filters/helpers/common/index.d.ts +1 -0
  75. package/dist/cjs/filters/helpers/common/index.js +1 -0
  76. package/dist/cjs/filters/interfaces/IFDateProperty.d.ts +1 -1
  77. package/dist/cjs/filters/interfaces/IFDateSection.d.ts +1 -1
  78. package/dist/cjs/filters/interfaces/IFOperator.d.ts +1 -1
  79. package/dist/cjs/filters/interfaces/IFProperty.d.ts +1 -1
  80. package/dist/cjs/filters/interfaces/IFScope.d.ts +1 -1
  81. package/dist/cjs/filters/interfaces/IFSection.d.ts +1 -1
  82. package/dist/cjs/filters/interfaces/IFStructureType.d.ts +1 -1
  83. package/dist/cjs/filters/interfaces/IFValidator.d.ts +1 -1
  84. package/dist/cjs/filters/interfaces/IFValue.d.ts +1 -1
  85. package/dist/cjs/filters/interfaces/OLD_IFilterExpression.d.ts +2 -2
  86. package/dist/cjs/filters/interfaces/backend/IFBExpressionRelativeDate.d.ts +1 -1
  87. package/dist/cjs/filters/interfaces/backend/IFBExpressionValue.d.ts +1 -1
  88. package/dist/cjs/filters/interfaces/backend/IFBackendExpressionValue.d.ts +1 -1
  89. package/dist/cjs/filters/interfaces/backend/IFBackendValidator.d.ts +1 -1
  90. package/dist/cjs/filters/interfaces/common/IFSColumn.d.ts +1 -1
  91. package/dist/cjs/filters/interfaces/common/IFSGetDataValues.d.ts +1 -1
  92. package/dist/cjs/filters/interfaces/common/IFSValueRelativeDate.d.ts +1 -1
  93. package/dist/cjs/filters/interfaces/common/IFilterConfig.d.ts +1 -1
  94. package/dist/cjs/filters/interfaces/panel/IFPAction.d.ts +1 -1
  95. package/dist/cjs/filters/interfaces/settings/IFSettingsPanelView.d.ts +1 -1
  96. package/dist/cjs/filters/interfaces/settings/IFSettingsScopes.d.ts +1 -1
  97. package/dist/cjs/filters/interfaces/ui/IFUTransformFilterValuesSettings.d.ts +6 -0
  98. package/dist/cjs/format/duration/durationFormatter.js +2 -1
  99. package/dist/cjs/format/format.d.ts +1 -1
  100. package/dist/cjs/format/format.js +10 -4
  101. package/dist/cjs/formulas/interfaces/IFormulaType.d.ts +1 -1
  102. package/dist/cjs/general/array/addPropertyToArrayOfObjects.d.ts +1 -1
  103. package/dist/cjs/general/index.d.ts +1 -0
  104. package/dist/cjs/general/index.js +1 -0
  105. package/dist/cjs/general/mix/importScripts.d.ts +2 -2
  106. package/dist/cjs/general/numeric/getSign.d.ts +6 -0
  107. package/dist/cjs/general/numeric/getSign.js +12 -0
  108. package/dist/cjs/general/numeric/index.d.ts +1 -0
  109. package/dist/cjs/general/numeric/index.js +17 -0
  110. package/dist/cjs/general/object/applyTimezoneDeep.d.ts +8 -0
  111. package/dist/cjs/general/object/applyTimezoneDeep.js +48 -0
  112. package/dist/cjs/general/object/index.d.ts +1 -0
  113. package/dist/cjs/general/object/index.js +1 -0
  114. package/dist/cjs/globalization/labels/chart_builder/I18N_CHART_BUILDER_FORMAT_OPTIONS.d.ts +1 -1
  115. package/dist/cjs/globalization/labels/chart_builder/I18N_CHART_BUILDER_GENERAL.d.ts +1 -1
  116. package/dist/cjs/globalization/labels/chart_builder/I18N_CHART_BUILDER_GENERAL_OPTIONS.d.ts +1 -1
  117. package/dist/cjs/globalization/labels/chart_builder/I18N_CHART_BUILDER_LAYER_OPTIONS.d.ts +1 -1
  118. package/dist/cjs/globalization/labels/chart_builder/I18N_CHART_BUILDER_OPERATORS.d.ts +1 -1
  119. package/dist/cjs/globalization/labels/chart_builder/I18N_CHART_BUILDER_STYLE_OPTIONS.d.ts +1 -1
  120. package/dist/cjs/globalization/labels/chart_builder/I18N_CHART_BUILDER_THRESHOLD.d.ts +1 -1
  121. package/dist/cjs/globalization/labels/chart_builder/I18N_CHART_BUILDER_TIME_PERIOD.d.ts +1 -1
  122. package/dist/cjs/interfaces/Chart.Interface.d.ts +1 -1
  123. package/dist/cjs/interfaces/IChartBuilder.Interface.d.ts +1 -1
  124. package/dist/cjs/interfaces/Qrvey.Interface.d.ts +2 -2
  125. package/dist/cjs/interfaces/format/IFormatConfig.Interface.d.ts +1 -0
  126. package/dist/cjs/interfaces/general/IWidgetConfig.d.ts +2 -1
  127. package/dist/cjs/qrvey/helpers/transformValue.js +34 -6
  128. package/dist/cjs/qrvey/interfaces/IAppStatus.d.ts +1 -1
  129. package/dist/cjs/qrvey/interfaces/IAppType.d.ts +1 -1
  130. package/dist/cjs/qrvey/interfaces/IBDataset.d.ts +2 -0
  131. package/dist/cjs/qrvey/interfaces/IBModel.d.ts +5 -0
  132. package/dist/cjs/qrvey/interfaces/ICalculation.d.ts +1 -1
  133. package/dist/cjs/qrvey/interfaces/ICalculationType.d.ts +1 -1
  134. package/dist/cjs/qrvey/interfaces/IDataset.d.ts +3 -1
  135. package/dist/cjs/qrvey/interfaces/IModel.d.ts +3 -1
  136. package/dist/cjs/qrvey/interfaces/ITransformValueSettings.d.ts +6 -0
  137. package/dist/cjs/services/adapters/BDatasetsToUIDatasets.adapter.js +2 -0
  138. package/dist/cjs/services/adapters/BModelToUIModel.adapter.js +2 -0
  139. package/dist/cjs/services/adapters/BTimezoneToUITimezone.d.ts +8 -0
  140. package/dist/cjs/services/adapters/BTimezoneToUITimezone.js +18 -0
  141. package/dist/cjs/services/helpers/Request.d.ts +1 -1
  142. package/dist/cjs/services/helpers/Request.js +11 -5
  143. package/dist/cjs/typescript/DeepPartial.d.ts +1 -1
  144. package/dist/cjs/typescript/DeepRequired.d.ts +1 -1
  145. package/dist/cjs/typescript/ValueOf.d.ts +1 -1
  146. package/dist/column_format/interfaces/IChartGroupType.d.ts +1 -1
  147. package/dist/column_format/interfaces/IChartShelfType.d.ts +1 -1
  148. package/dist/column_format/interfaces/IChartTableType.d.ts +1 -1
  149. package/dist/column_format/interfaces/IColumnFormatReturnType.d.ts +1 -1
  150. package/dist/column_format/interfaces/IFormatStringType.d.ts +1 -1
  151. package/dist/columns/interfaces/IColumnImageUploadOption.d.ts +1 -1
  152. package/dist/columns/interfaces/IColumnPropertyType.d.ts +1 -1
  153. package/dist/columns/interfaces/IColumnType.d.ts +1 -1
  154. package/dist/columns/interfaces/IComplexColumnPropertyType.d.ts +1 -1
  155. package/dist/columns/interfaces/IComplexColumnType.d.ts +1 -1
  156. package/dist/columns/interfaces/ICompoundColumnPropertyType.d.ts +1 -1
  157. package/dist/columns/interfaces/ICompoundColumnType.d.ts +1 -1
  158. package/dist/columns/interfaces/IDateColumnPropertyType.d.ts +1 -1
  159. package/dist/columns/interfaces/INumericalColumnType.d.ts +1 -1
  160. package/dist/dates/adapters/ISOToNumericOffset.d.ts +6 -0
  161. package/dist/dates/adapters/ISOToNumericOffset.js +17 -0
  162. package/dist/dates/adapters/index.d.ts +2 -0
  163. package/dist/dates/adapters/index.js +2 -0
  164. package/dist/dates/adapters/numericOffsetToISO.d.ts +6 -0
  165. package/dist/dates/adapters/numericOffsetToISO.js +25 -0
  166. package/dist/dates/constants/ISO_8601_REGEX.d.ts +1 -0
  167. package/dist/dates/constants/ISO_8601_REGEX.js +1 -0
  168. package/dist/dates/constants/TIMEZONE_TYPE.d.ts +5 -0
  169. package/dist/dates/constants/TIMEZONE_TYPE.js +6 -0
  170. package/dist/dates/constants/index.d.ts +1 -0
  171. package/dist/dates/constants/index.js +1 -0
  172. package/dist/dates/helpers/getDateByTimezone.d.ts +8 -0
  173. package/dist/dates/helpers/getDateByTimezone.js +37 -0
  174. package/dist/dates/helpers/getDateByTimezoneOffset.d.ts +7 -0
  175. package/dist/dates/helpers/getDateByTimezoneOffset.js +18 -0
  176. package/dist/dates/helpers/getTimezoneObject.d.ts +10 -0
  177. package/dist/dates/helpers/getTimezoneObject.js +17 -0
  178. package/dist/dates/helpers/getTimezoneOffsetByType.d.ts +13 -0
  179. package/dist/dates/helpers/getTimezoneOffsetByType.js +23 -0
  180. package/dist/dates/helpers/index.d.ts +4 -1
  181. package/dist/dates/helpers/index.js +4 -1
  182. package/dist/dates/helpers/isValidISOOffset.d.ts +7 -0
  183. package/dist/dates/helpers/isValidISOOffset.js +13 -0
  184. package/dist/dates/interfaces/IBTimezone.d.ts +7 -0
  185. package/dist/dates/interfaces/IBTimezone.js +1 -0
  186. package/dist/dates/interfaces/IBTimezoneType.d.ts +2 -0
  187. package/dist/dates/interfaces/IBTimezoneType.js +1 -0
  188. package/dist/dates/interfaces/IDTimezone.d.ts +6 -0
  189. package/dist/dates/interfaces/IDTimezone.js +1 -0
  190. package/dist/dates/interfaces/IDTimezoneOffset.d.ts +1 -0
  191. package/dist/dates/interfaces/IDTimezoneOffset.js +1 -0
  192. package/dist/dates/interfaces/IDTimezoneType.d.ts +2 -0
  193. package/dist/dates/interfaces/IDTimezoneType.js +1 -0
  194. package/dist/dates/interfaces/IDateFormat.d.ts +1 -1
  195. package/dist/dates/interfaces/IDateGroupingProperty.d.ts +1 -1
  196. package/dist/dates/interfaces/IGetDateByTimezoneSettings.d.ts +6 -0
  197. package/dist/dates/interfaces/IGetDateByTimezoneSettings.js +1 -0
  198. package/dist/dates/interfaces/index.d.ts +6 -0
  199. package/dist/dates/interfaces/index.js +6 -0
  200. package/dist/dates/relative/helpers/parseDate.d.ts +2 -2
  201. package/dist/dates/relative/interfaces/IRelativeUnit.d.ts +1 -1
  202. package/dist/dates/relative/interfaces/RelativeCursor.d.ts +1 -1
  203. package/dist/dates/relative/interfaces/RelativeInput.d.ts +1 -1
  204. package/dist/dates/relative/interfaces/ui/IRelativeSectionMode.d.ts +1 -1
  205. package/dist/filters/helpers/builder/getFilterBuilderGeneralConfig.js +1 -1
  206. package/dist/filters/helpers/common/excludeFiltersByParams.js +5 -5
  207. package/dist/filters/helpers/common/getFiltersByTimezone.d.ts +10 -0
  208. package/dist/filters/helpers/common/getFiltersByTimezone.js +22 -0
  209. package/dist/filters/helpers/common/index.d.ts +1 -0
  210. package/dist/filters/helpers/common/index.js +1 -0
  211. package/dist/filters/interfaces/IFDateProperty.d.ts +1 -1
  212. package/dist/filters/interfaces/IFDateSection.d.ts +1 -1
  213. package/dist/filters/interfaces/IFOperator.d.ts +1 -1
  214. package/dist/filters/interfaces/IFProperty.d.ts +1 -1
  215. package/dist/filters/interfaces/IFScope.d.ts +1 -1
  216. package/dist/filters/interfaces/IFSection.d.ts +1 -1
  217. package/dist/filters/interfaces/IFStructureType.d.ts +1 -1
  218. package/dist/filters/interfaces/IFValidator.d.ts +1 -1
  219. package/dist/filters/interfaces/IFValue.d.ts +1 -1
  220. package/dist/filters/interfaces/OLD_IFilterExpression.d.ts +2 -2
  221. package/dist/filters/interfaces/backend/IFBExpressionRelativeDate.d.ts +1 -1
  222. package/dist/filters/interfaces/backend/IFBExpressionValue.d.ts +1 -1
  223. package/dist/filters/interfaces/backend/IFBackendExpressionValue.d.ts +1 -1
  224. package/dist/filters/interfaces/backend/IFBackendValidator.d.ts +1 -1
  225. package/dist/filters/interfaces/common/IFSColumn.d.ts +1 -1
  226. package/dist/filters/interfaces/common/IFSGetDataValues.d.ts +1 -1
  227. package/dist/filters/interfaces/common/IFSValueRelativeDate.d.ts +1 -1
  228. package/dist/filters/interfaces/common/IFilterConfig.d.ts +1 -1
  229. package/dist/filters/interfaces/panel/IFPAction.d.ts +1 -1
  230. package/dist/filters/interfaces/settings/IFSettingsPanelView.d.ts +1 -1
  231. package/dist/filters/interfaces/settings/IFSettingsScopes.d.ts +1 -1
  232. package/dist/filters/interfaces/ui/IFUTransformFilterValuesSettings.d.ts +6 -0
  233. package/dist/format/duration/durationFormatter.js +2 -1
  234. package/dist/format/format.d.ts +1 -1
  235. package/dist/format/format.js +10 -4
  236. package/dist/formulas/interfaces/IFormulaType.d.ts +1 -1
  237. package/dist/general/array/addPropertyToArrayOfObjects.d.ts +1 -1
  238. package/dist/general/index.d.ts +1 -0
  239. package/dist/general/index.js +1 -0
  240. package/dist/general/mix/importScripts.d.ts +2 -2
  241. package/dist/general/numeric/getSign.d.ts +6 -0
  242. package/dist/general/numeric/getSign.js +8 -0
  243. package/dist/general/numeric/index.d.ts +1 -0
  244. package/dist/general/numeric/index.js +1 -0
  245. package/dist/general/object/applyTimezoneDeep.d.ts +8 -0
  246. package/dist/general/object/applyTimezoneDeep.js +44 -0
  247. package/dist/general/object/index.d.ts +1 -0
  248. package/dist/general/object/index.js +1 -0
  249. package/dist/globalization/labels/chart_builder/I18N_CHART_BUILDER_FORMAT_OPTIONS.d.ts +1 -1
  250. package/dist/globalization/labels/chart_builder/I18N_CHART_BUILDER_GENERAL.d.ts +1 -1
  251. package/dist/globalization/labels/chart_builder/I18N_CHART_BUILDER_GENERAL_OPTIONS.d.ts +1 -1
  252. package/dist/globalization/labels/chart_builder/I18N_CHART_BUILDER_LAYER_OPTIONS.d.ts +1 -1
  253. package/dist/globalization/labels/chart_builder/I18N_CHART_BUILDER_OPERATORS.d.ts +1 -1
  254. package/dist/globalization/labels/chart_builder/I18N_CHART_BUILDER_STYLE_OPTIONS.d.ts +1 -1
  255. package/dist/globalization/labels/chart_builder/I18N_CHART_BUILDER_THRESHOLD.d.ts +1 -1
  256. package/dist/globalization/labels/chart_builder/I18N_CHART_BUILDER_TIME_PERIOD.d.ts +1 -1
  257. package/dist/interfaces/Chart.Interface.d.ts +1 -1
  258. package/dist/interfaces/IChartBuilder.Interface.d.ts +1 -1
  259. package/dist/interfaces/Qrvey.Interface.d.ts +2 -2
  260. package/dist/interfaces/format/IFormatConfig.Interface.d.ts +1 -0
  261. package/dist/interfaces/general/IWidgetConfig.d.ts +2 -1
  262. package/dist/qrvey/helpers/transformValue.js +34 -6
  263. package/dist/qrvey/interfaces/IAppStatus.d.ts +1 -1
  264. package/dist/qrvey/interfaces/IAppType.d.ts +1 -1
  265. package/dist/qrvey/interfaces/IBDataset.d.ts +2 -0
  266. package/dist/qrvey/interfaces/IBModel.d.ts +5 -0
  267. package/dist/qrvey/interfaces/ICalculation.d.ts +1 -1
  268. package/dist/qrvey/interfaces/ICalculationType.d.ts +1 -1
  269. package/dist/qrvey/interfaces/IDataset.d.ts +3 -1
  270. package/dist/qrvey/interfaces/IModel.d.ts +3 -1
  271. package/dist/qrvey/interfaces/ITransformValueSettings.d.ts +6 -0
  272. package/dist/services/adapters/BDatasetsToUIDatasets.adapter.js +2 -0
  273. package/dist/services/adapters/BModelToUIModel.adapter.js +2 -0
  274. package/dist/services/adapters/BTimezoneToUITimezone.d.ts +8 -0
  275. package/dist/services/adapters/BTimezoneToUITimezone.js +14 -0
  276. package/dist/services/helpers/Request.d.ts +1 -1
  277. package/dist/services/helpers/Request.js +11 -5
  278. package/dist/typescript/DeepPartial.d.ts +1 -1
  279. package/dist/typescript/DeepRequired.d.ts +1 -1
  280. package/dist/typescript/ValueOf.d.ts +1 -1
  281. package/package.json +20 -19
  282. package/dist/cjs/dates/helpers/adjustTimezone.d.ts +0 -6
  283. package/dist/cjs/dates/helpers/adjustTimezone.js +0 -19
  284. package/dist/dates/helpers/adjustTimezone.d.ts +0 -6
  285. package/dist/dates/helpers/adjustTimezone.js +0 -15
@@ -401,7 +401,6 @@ export function configMetricData(metricObj //
401
401
  }
402
402
  if (data.dateColumn) {
403
403
  const dateColum = data.dateColumn.id;
404
- const timeZoneOffset = 0;
405
404
  // TIME PERIOD
406
405
  try {
407
406
  const timePeriod = data.timePeriod.label;
@@ -409,7 +408,6 @@ export function configMetricData(metricObj //
409
408
  id: dateColum,
410
409
  type: timePeriod,
411
410
  dataType: data.dateColumn.type,
412
- timeZoneOffset,
413
411
  };
414
412
  if (timePeriod === "CUSTOM_RANGE") {
415
413
  const type = data.timePeriodCustomRange.label;
@@ -442,7 +440,6 @@ export function configMetricData(metricObj //
442
440
  id: dateColum,
443
441
  type: comparison,
444
442
  dataType: data.dateColumn.type,
445
- timeZoneOffset,
446
443
  };
447
444
  if (comparison === "CUSTOM_RANGE") {
448
445
  const type = data.comparisonCustomRange.label;
@@ -1,2 +1,2 @@
1
1
  import { AGGREGATE_ABBREVIATION } from "../constants/AGGREGATE_ABBREVIATION";
2
- export declare type IAggregateAbbreviation = AGGREGATE_ABBREVIATION;
2
+ export type IAggregateAbbreviation = AGGREGATE_ABBREVIATION;
@@ -1,2 +1,2 @@
1
1
  import { AGGREGATE_LABEL } from "../constants/AGGREGATE_LABEL";
2
- export declare type IAggregateLabel = AGGREGATE_LABEL;
2
+ export type IAggregateLabel = AGGREGATE_LABEL;
@@ -1,2 +1,2 @@
1
1
  import { AGGREGATE } from "../constants/AGGREGATE";
2
- export declare type IAggregateType = AGGREGATE;
2
+ export type IAggregateType = AGGREGATE;
@@ -17,7 +17,7 @@ export interface MetricRequestPayload {
17
17
  * example, if you want to aggregate the number of times a question was answered, you would use the
18
18
  * property "answered".
19
19
  */
20
- export declare type MetricValue = {
20
+ export type MetricValue = {
21
21
  aggregate: AGGREGATE_LABEL;
22
22
  questionid: string;
23
23
  property?: string | null;
@@ -36,7 +36,7 @@ export declare type MetricValue = {
36
36
  * @property {boolean} isCalendarDate - If true, the date is a calendar date, otherwise it's a relative
37
37
  * date.
38
38
  */
39
- export declare type RelativeDateConfig = {
39
+ export type RelativeDateConfig = {
40
40
  questionid: string;
41
41
  cursor: RelativeCursor;
42
42
  number?: number;
@@ -50,7 +50,7 @@ export declare type RelativeDateConfig = {
50
50
  * `CustomRange`.
51
51
  * @property {CustomRange} customRange - The custom range to use for the metric.
52
52
  */
53
- export declare type MetricCustomRange = {
53
+ export type MetricCustomRange = {
54
54
  customRange: CustomRange;
55
55
  type?: IColumnType;
56
56
  };
@@ -60,7 +60,7 @@ export declare type MetricCustomRange = {
60
60
  * @property {string} endDate - The end date of the custom range.
61
61
  * @property {TP_CUSTOM_RANGE} label - The label for the custom range.
62
62
  */
63
- export declare type CustomRangeConfig = {
63
+ export type CustomRangeConfig = {
64
64
  startingDate?: string;
65
65
  endDate?: string;
66
66
  label?: TP_CUSTOM_RANGE;
@@ -70,7 +70,7 @@ export declare type CustomRangeConfig = {
70
70
  * @property {string} gte - Greater than or equal to
71
71
  * @property {string} lte - Less than or equal to
72
72
  */
73
- export declare type CustomRange = {
73
+ export type CustomRange = {
74
74
  gte?: string;
75
75
  lte?: string;
76
76
  };
@@ -84,19 +84,19 @@ export declare type CustomRange = {
84
84
  * @property {number} max - The maximum value of the metric
85
85
  * @property {number} comparison - The value of the metric for the previous period.
86
86
  */
87
- export declare type MetricRequestResponse = {
87
+ export type MetricRequestResponse = {
88
88
  value: number;
89
89
  min: number;
90
90
  max: number;
91
91
  comparison: number;
92
92
  };
93
- export declare type MetricPeriod = RelativeDateConfig;
94
- export declare type MetricComparison = RelativeDateConfig;
95
- export declare type MetricConfig = {
93
+ export type MetricPeriod = RelativeDateConfig;
94
+ export type MetricComparison = RelativeDateConfig;
95
+ export type MetricConfig = {
96
96
  logic: IFBLogic[];
97
97
  data: MetricConfigData;
98
98
  };
99
- export declare type MetricConfigData = {
99
+ export type MetricConfigData = {
100
100
  dateColumn: IBColumn;
101
101
  timePeriod: MetricTimeInfo;
102
102
  timePeriodCustomRange: MetricTimeCustomRange;
@@ -114,12 +114,12 @@ export declare type MetricConfigData = {
114
114
  label: AGGREGATE_LABEL;
115
115
  };
116
116
  };
117
- export declare type MetricTimeCustomRange = {
117
+ export type MetricTimeCustomRange = {
118
118
  key: string;
119
119
  label: TP_CUSTOM_RANGE;
120
120
  text: string;
121
121
  };
122
- export declare type MetricTimeInfo = {
122
+ export type MetricTimeInfo = {
123
123
  key: string;
124
124
  label: TimePeriod;
125
125
  text: string;
@@ -405,7 +405,6 @@ function configMetricData(metricObj //
405
405
  }
406
406
  if (data.dateColumn) {
407
407
  const dateColum = data.dateColumn.id;
408
- const timeZoneOffset = 0;
409
408
  // TIME PERIOD
410
409
  try {
411
410
  const timePeriod = data.timePeriod.label;
@@ -413,7 +412,6 @@ function configMetricData(metricObj //
413
412
  id: dateColum,
414
413
  type: timePeriod,
415
414
  dataType: data.dateColumn.type,
416
- timeZoneOffset,
417
415
  };
418
416
  if (timePeriod === "CUSTOM_RANGE") {
419
417
  const type = data.timePeriodCustomRange.label;
@@ -446,7 +444,6 @@ function configMetricData(metricObj //
446
444
  id: dateColum,
447
445
  type: comparison,
448
446
  dataType: data.dateColumn.type,
449
- timeZoneOffset,
450
447
  };
451
448
  if (comparison === "CUSTOM_RANGE") {
452
449
  const type = data.comparisonCustomRange.label;
@@ -1,2 +1,2 @@
1
1
  import { AGGREGATE_ABBREVIATION } from "../constants/AGGREGATE_ABBREVIATION";
2
- export declare type IAggregateAbbreviation = AGGREGATE_ABBREVIATION;
2
+ export type IAggregateAbbreviation = AGGREGATE_ABBREVIATION;
@@ -1,2 +1,2 @@
1
1
  import { AGGREGATE_LABEL } from "../constants/AGGREGATE_LABEL";
2
- export declare type IAggregateLabel = AGGREGATE_LABEL;
2
+ export type IAggregateLabel = AGGREGATE_LABEL;
@@ -1,2 +1,2 @@
1
1
  import { AGGREGATE } from "../constants/AGGREGATE";
2
- export declare type IAggregateType = AGGREGATE;
2
+ export type IAggregateType = AGGREGATE;
@@ -17,7 +17,7 @@ export interface MetricRequestPayload {
17
17
  * example, if you want to aggregate the number of times a question was answered, you would use the
18
18
  * property "answered".
19
19
  */
20
- export declare type MetricValue = {
20
+ export type MetricValue = {
21
21
  aggregate: AGGREGATE_LABEL;
22
22
  questionid: string;
23
23
  property?: string | null;
@@ -36,7 +36,7 @@ export declare type MetricValue = {
36
36
  * @property {boolean} isCalendarDate - If true, the date is a calendar date, otherwise it's a relative
37
37
  * date.
38
38
  */
39
- export declare type RelativeDateConfig = {
39
+ export type RelativeDateConfig = {
40
40
  questionid: string;
41
41
  cursor: RelativeCursor;
42
42
  number?: number;
@@ -50,7 +50,7 @@ export declare type RelativeDateConfig = {
50
50
  * `CustomRange`.
51
51
  * @property {CustomRange} customRange - The custom range to use for the metric.
52
52
  */
53
- export declare type MetricCustomRange = {
53
+ export type MetricCustomRange = {
54
54
  customRange: CustomRange;
55
55
  type?: IColumnType;
56
56
  };
@@ -60,7 +60,7 @@ export declare type MetricCustomRange = {
60
60
  * @property {string} endDate - The end date of the custom range.
61
61
  * @property {TP_CUSTOM_RANGE} label - The label for the custom range.
62
62
  */
63
- export declare type CustomRangeConfig = {
63
+ export type CustomRangeConfig = {
64
64
  startingDate?: string;
65
65
  endDate?: string;
66
66
  label?: TP_CUSTOM_RANGE;
@@ -70,7 +70,7 @@ export declare type CustomRangeConfig = {
70
70
  * @property {string} gte - Greater than or equal to
71
71
  * @property {string} lte - Less than or equal to
72
72
  */
73
- export declare type CustomRange = {
73
+ export type CustomRange = {
74
74
  gte?: string;
75
75
  lte?: string;
76
76
  };
@@ -84,19 +84,19 @@ export declare type CustomRange = {
84
84
  * @property {number} max - The maximum value of the metric
85
85
  * @property {number} comparison - The value of the metric for the previous period.
86
86
  */
87
- export declare type MetricRequestResponse = {
87
+ export type MetricRequestResponse = {
88
88
  value: number;
89
89
  min: number;
90
90
  max: number;
91
91
  comparison: number;
92
92
  };
93
- export declare type MetricPeriod = RelativeDateConfig;
94
- export declare type MetricComparison = RelativeDateConfig;
95
- export declare type MetricConfig = {
93
+ export type MetricPeriod = RelativeDateConfig;
94
+ export type MetricComparison = RelativeDateConfig;
95
+ export type MetricConfig = {
96
96
  logic: IFBLogic[];
97
97
  data: MetricConfigData;
98
98
  };
99
- export declare type MetricConfigData = {
99
+ export type MetricConfigData = {
100
100
  dateColumn: IBColumn;
101
101
  timePeriod: MetricTimeInfo;
102
102
  timePeriodCustomRange: MetricTimeCustomRange;
@@ -114,12 +114,12 @@ export declare type MetricConfigData = {
114
114
  label: AGGREGATE_LABEL;
115
115
  };
116
116
  };
117
- export declare type MetricTimeCustomRange = {
117
+ export type MetricTimeCustomRange = {
118
118
  key: string;
119
119
  label: TP_CUSTOM_RANGE;
120
120
  text: string;
121
121
  };
122
- export declare type MetricTimeInfo = {
122
+ export type MetricTimeInfo = {
123
123
  key: string;
124
124
  label: TimePeriod;
125
125
  text: string;
@@ -1,2 +1,2 @@
1
1
  import { CHART_GROUPS } from "../constants/CHART_GROUP";
2
- export declare type IChartGroupType = CHART_GROUPS;
2
+ export type IChartGroupType = CHART_GROUPS;
@@ -1,2 +1,2 @@
1
1
  import { SHELF_TYPE } from "../constants/SHELF_TYPE";
2
- export declare type IChartShelfType = SHELF_TYPE;
2
+ export type IChartShelfType = SHELF_TYPE;
@@ -1,2 +1,2 @@
1
1
  import { TABLE_TYPE } from "../constants/TABLE_TYPE";
2
- export declare type IChartTableType = TABLE_TYPE;
2
+ export type IChartTableType = TABLE_TYPE;
@@ -1,3 +1,3 @@
1
1
  import { IFormatOutputFormat } from "../..";
2
2
  import { IFormatStringType } from "./IFormatStringType";
3
- export declare type IColumnFormatReturnType = IFormatStringType | IFormatOutputFormat;
3
+ export type IColumnFormatReturnType = IFormatStringType | IFormatOutputFormat;
@@ -1,2 +1,2 @@
1
1
  import { STRING_FORMAT } from "../constants/STRING_FORMAT";
2
- export declare type IFormatStringType = STRING_FORMAT;
2
+ export type IFormatStringType = STRING_FORMAT;
@@ -1,2 +1,2 @@
1
1
  import { COLUMN_IMAGE_UPLOAD_OPTION } from "../constants/COLUMN_IMAGE_UPLOAD_OPTION";
2
- export declare type IColumnImageUploadOption = COLUMN_IMAGE_UPLOAD_OPTION;
2
+ export type IColumnImageUploadOption = COLUMN_IMAGE_UPLOAD_OPTION;
@@ -2,4 +2,4 @@ import { ICompoundColumnPropertyType } from "./ICompoundColumnPropertyType";
2
2
  import { IDateColumnPropertyType } from "./IDateColumnPropertyType";
3
3
  import { COLUMN_PROPERTY } from "../constants/COLUMN_PROPERTY";
4
4
  import { IComplexColumnPropertyType } from "./IComplexColumnPropertyType";
5
- export declare type IColumnPropertyType = COLUMN_PROPERTY | IComplexColumnPropertyType | ICompoundColumnPropertyType | IDateColumnPropertyType;
5
+ export type IColumnPropertyType = COLUMN_PROPERTY | IComplexColumnPropertyType | ICompoundColumnPropertyType | IDateColumnPropertyType;
@@ -2,4 +2,4 @@ import { IComplexColumnType } from "./IComplexColumnType";
2
2
  import { ICompoundColumnType } from "./ICompoundColumnType";
3
3
  import { COLUMN } from "../constants/COLUMN";
4
4
  import { INumericalColumnType } from "./INumericalColumnType";
5
- export declare type IColumnType = COLUMN | ICompoundColumnType | IComplexColumnType | INumericalColumnType;
5
+ export type IColumnType = COLUMN | ICompoundColumnType | IComplexColumnType | INumericalColumnType;
@@ -1,2 +1,2 @@
1
1
  import { COMPLEX_COLUMN_PROPERTY } from "../constants/COMPLEX_COLUMN_PROPERTY";
2
- export declare type IComplexColumnPropertyType = COMPLEX_COLUMN_PROPERTY;
2
+ export type IComplexColumnPropertyType = COMPLEX_COLUMN_PROPERTY;
@@ -1,2 +1,2 @@
1
1
  import { COMPLEX_COLUMN } from "../constants/COMPLEX_COLUMN";
2
- export declare type IComplexColumnType = COMPLEX_COLUMN;
2
+ export type IComplexColumnType = COMPLEX_COLUMN;
@@ -1,2 +1,2 @@
1
1
  import { COMPOUND_COLUMN_PROPERTY } from "../constants/COMPOUND_COLUMN_PROPERTY";
2
- export declare type ICompoundColumnPropertyType = COMPOUND_COLUMN_PROPERTY;
2
+ export type ICompoundColumnPropertyType = COMPOUND_COLUMN_PROPERTY;
@@ -1,2 +1,2 @@
1
1
  import { COMPOUND_COLUMN } from "../constants/COMPOUND_COLUMN";
2
- export declare type ICompoundColumnType = COMPOUND_COLUMN;
2
+ export type ICompoundColumnType = COMPOUND_COLUMN;
@@ -2,4 +2,4 @@ import { DATE_GROUPING_TIME_PROPERTY } from "../../dates/constants/DATE_GROUPING
2
2
  import { DATE_GROUPING_PROPERTY } from "../../dates/constants/DATE_GROUPING_PROPERTY";
3
3
  import { DATE_DISTINCT_PROPERTY } from "../../dates/constants/DATE_DISTINCT_PROPERTY";
4
4
  import { DATE_DISTINCT_TIME_PROPERTY } from "../../dates/constants/DATE_DISTINCT_TIME_PROPERTY";
5
- export declare type IDateColumnPropertyType = DATE_GROUPING_PROPERTY | DATE_GROUPING_TIME_PROPERTY | DATE_DISTINCT_PROPERTY | DATE_DISTINCT_TIME_PROPERTY;
5
+ export type IDateColumnPropertyType = DATE_GROUPING_PROPERTY | DATE_GROUPING_TIME_PROPERTY | DATE_DISTINCT_PROPERTY | DATE_DISTINCT_TIME_PROPERTY;
@@ -1,2 +1,2 @@
1
1
  import { NUMERICAL_COLUMN } from "../constants/NUMERICAL_COLUMN";
2
- export declare type INumericalColumnType = NUMERICAL_COLUMN;
2
+ export type INumericalColumnType = NUMERICAL_COLUMN;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Gets the numeric offset (minutes) from the ISO offset (string)
3
+ * @param {string} offset the timezone offset
4
+ * @returns {number} the offset in minutes
5
+ */
6
+ export declare function ISOToNumericOffset(offset: number | string): number;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ISOToNumericOffset = void 0;
4
+ const isNaNV2_1 = require("../../general/mix/isNaNV2");
5
+ const isValidISOOffset_1 = require("../helpers/isValidISOOffset");
6
+ /**
7
+ * Gets the numeric offset (minutes) from the ISO offset (string)
8
+ * @param {string} offset the timezone offset
9
+ * @returns {number} the offset in minutes
10
+ */
11
+ function ISOToNumericOffset(offset) {
12
+ if (typeof offset === "string" && offset === "browser")
13
+ return -1 * new Date().getTimezoneOffset();
14
+ if (typeof offset === "number" || !(0, isNaNV2_1.isNaNV2)(offset))
15
+ return +offset;
16
+ if (!(0, isValidISOOffset_1.isValidISOOffset)(offset))
17
+ return 0;
18
+ const [hours, minutes] = offset.split(":").map(Number);
19
+ return hours * 60 + minutes;
20
+ }
21
+ exports.ISOToNumericOffset = ISOToNumericOffset;
@@ -5,8 +5,10 @@ export * from "./dateToQuarterYear";
5
5
  export * from "./dateToWeekYear";
6
6
  export * from "./dateToYear";
7
7
  export * from "./hmsToDate";
8
+ export * from "./ISOToNumericOffset";
8
9
  export * from "./mdyDateToDate";
9
10
  export * from "./monthYearToDate";
11
+ export * from "./numericOffsetToISO";
10
12
  export * from "./quarterYearToDate";
11
13
  export * from "./weekYearToDate";
12
14
  export * from "./yearToDate";
@@ -21,8 +21,10 @@ __exportStar(require("./dateToQuarterYear"), exports);
21
21
  __exportStar(require("./dateToWeekYear"), exports);
22
22
  __exportStar(require("./dateToYear"), exports);
23
23
  __exportStar(require("./hmsToDate"), exports);
24
+ __exportStar(require("./ISOToNumericOffset"), exports);
24
25
  __exportStar(require("./mdyDateToDate"), exports);
25
26
  __exportStar(require("./monthYearToDate"), exports);
27
+ __exportStar(require("./numericOffsetToISO"), exports);
26
28
  __exportStar(require("./quarterYearToDate"), exports);
27
29
  __exportStar(require("./weekYearToDate"), exports);
28
30
  __exportStar(require("./yearToDate"), exports);
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Gets the ISO offset From the numeric offset (minutes)
3
+ * @param {number} offset the timezone offset
4
+ * @returns {string} the offset in minutes
5
+ */
6
+ export declare function numericOffsetToISO(offset: number | string): string;
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.numericOffsetToISO = void 0;
4
+ const isNaNV2_1 = require("../../general/mix/isNaNV2");
5
+ const getSign_1 = require("../../general/numeric/getSign");
6
+ const padLeadingZeros_1 = require("../../general/string/padLeadingZeros");
7
+ const isValidISOOffset_1 = require("../helpers/isValidISOOffset");
8
+ /**
9
+ * Gets the ISO offset From the numeric offset (minutes)
10
+ * @param {number} offset the timezone offset
11
+ * @returns {string} the offset in minutes
12
+ */
13
+ function numericOffsetToISO(offset) {
14
+ let newOffset = offset;
15
+ if (typeof offset === "string" && offset === "browser")
16
+ newOffset = -1 * new Date().getTimezoneOffset();
17
+ if (typeof newOffset === "string" && (0, isValidISOOffset_1.isValidISOOffset)(newOffset))
18
+ return String(newOffset);
19
+ if (typeof newOffset !== "number" && (0, isNaNV2_1.isNaNV2)(newOffset))
20
+ return "+00:00";
21
+ if (typeof newOffset === "string" && !(0, isNaNV2_1.isNaNV2)(newOffset))
22
+ newOffset = +newOffset;
23
+ const sign = (0, getSign_1.getSign)(newOffset);
24
+ newOffset = Math.abs(newOffset);
25
+ const hours = (0, padLeadingZeros_1.padLeadingZeros)(Math.floor(newOffset / 60), 2);
26
+ const minutes = (0, padLeadingZeros_1.padLeadingZeros)(newOffset % 60, 2);
27
+ return `${sign}${hours}:${minutes}`;
28
+ }
29
+ exports.numericOffsetToISO = numericOffsetToISO;
@@ -0,0 +1 @@
1
+ export declare const ISO_8601_REGEX: RegExp;
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ISO_8601_REGEX = void 0;
4
+ exports.ISO_8601_REGEX = /^[+-]?\d{2}:\d{2}$/;
@@ -0,0 +1,5 @@
1
+ export declare enum TIMEZONE_TYPE {
2
+ BROWSER = "BROWSER",
3
+ DEFAULT = "DEFAULT",
4
+ FIXED = "FIXED"
5
+ }
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TIMEZONE_TYPE = void 0;
4
+ var TIMEZONE_TYPE;
5
+ (function (TIMEZONE_TYPE) {
6
+ TIMEZONE_TYPE["BROWSER"] = "BROWSER";
7
+ TIMEZONE_TYPE["DEFAULT"] = "DEFAULT";
8
+ TIMEZONE_TYPE["FIXED"] = "FIXED";
9
+ })(TIMEZONE_TYPE = exports.TIMEZONE_TYPE || (exports.TIMEZONE_TYPE = {}));
@@ -38,6 +38,7 @@ export * from "./DATE_YEAR_MONTHS_MMMM";
38
38
  export * from "./DATE_YEAR_QUARTERS";
39
39
  export * from "./DATE_YEAR_QUARTERS_RANGE";
40
40
  export * from "./DATETIME_COLUMN_FORMAT";
41
+ export * from "./ISO_8601_REGEX";
41
42
  export * from "./TIME_GROUPING_PROPERTY_INFO_LIST";
42
43
  export * from "./TIME_GROUPING_PROPERTY_INFO";
43
44
  export * from "./TIME_GROUPING_PROPERTY_LABEL";
@@ -54,6 +54,7 @@ __exportStar(require("./DATE_YEAR_MONTHS_MMMM"), exports);
54
54
  __exportStar(require("./DATE_YEAR_QUARTERS"), exports);
55
55
  __exportStar(require("./DATE_YEAR_QUARTERS_RANGE"), exports);
56
56
  __exportStar(require("./DATETIME_COLUMN_FORMAT"), exports);
57
+ __exportStar(require("./ISO_8601_REGEX"), exports);
57
58
  __exportStar(require("./TIME_GROUPING_PROPERTY_INFO_LIST"), exports);
58
59
  __exportStar(require("./TIME_GROUPING_PROPERTY_INFO"), exports);
59
60
  __exportStar(require("./TIME_GROUPING_PROPERTY_LABEL"), exports);
@@ -0,0 +1,8 @@
1
+ import { IGetDateByTimezoneSettings } from "../interfaces/IGetDateByTimezoneSettings";
2
+ /**
3
+ * Gets a date value in the given timezone
4
+ * @param {string} date the date
5
+ * @param {IGetDateByTimezoneSettings} settings The settings of the getDateByTimezone function
6
+ * @returns {string} A transformed value
7
+ */
8
+ export declare function getDateByTimezone(date: string, settings: IGetDateByTimezoneSettings): string;
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getDateByTimezone = void 0;
4
+ const isEmpty_1 = require("../../general/mix/isEmpty");
5
+ const DATE_GROUPING_TIME_PROPERTY_1 = require("../constants/DATE_GROUPING_TIME_PROPERTY");
6
+ const TIMEZONE_TYPE_1 = require("../constants/TIMEZONE_TYPE");
7
+ const getDateByDateFormat_1 = require("./getDateByDateFormat");
8
+ const getDateByTimezoneOffset_1 = require("./getDateByTimezoneOffset");
9
+ const getDateFormatByProperty_1 = require("./getDateFormatByProperty");
10
+ const getFormattedDateByFormat_1 = require("./getFormattedDateByFormat");
11
+ /**
12
+ * Gets a date value in the given timezone
13
+ * @param {string} date the date
14
+ * @param {IGetDateByTimezoneSettings} settings The settings of the getDateByTimezone function
15
+ * @returns {string} A transformed value
16
+ */
17
+ function getDateByTimezone(date, settings) {
18
+ const defaultSettings = getDefaultSettings(settings);
19
+ const isDateTime = [
20
+ DATE_GROUPING_TIME_PROPERTY_1.DATE_GROUPING_TIME_PROPERTY.HOUR,
21
+ DATE_GROUPING_TIME_PROPERTY_1.DATE_GROUPING_TIME_PROPERTY.MINUTE,
22
+ DATE_GROUPING_TIME_PROPERTY_1.DATE_GROUPING_TIME_PROPERTY.SECOND,
23
+ ].includes(defaultSettings.property);
24
+ if (!(0, isEmpty_1.isEmpty)(defaultSettings.timezone.offset) && isDateTime) {
25
+ const dateFormat = (0, getDateFormatByProperty_1.getDateFormatByProperty)(defaultSettings.property);
26
+ const formattedDate = (0, getDateByDateFormat_1.getDateByDateFormat)(date, dateFormat);
27
+ const timezonedDate = (0, getDateByTimezoneOffset_1.getDateByTimezoneOffset)(formattedDate, defaultSettings.timezone.offset);
28
+ return (0, getFormattedDateByFormat_1.getFormattedDateByFormat)(timezonedDate, dateFormat);
29
+ }
30
+ return date;
31
+ }
32
+ exports.getDateByTimezone = getDateByTimezone;
33
+ function getDefaultSettings(settings) {
34
+ return {
35
+ property: settings.property,
36
+ timezone: (settings === null || settings === void 0 ? void 0 : settings.timezone) || {
37
+ offset: undefined,
38
+ type: TIMEZONE_TYPE_1.TIMEZONE_TYPE.DEFAULT,
39
+ },
40
+ };
41
+ }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Gets a Date with the given offset of the Timezone.
3
+ * No given an offset the default is going to be set by the browser
4
+ * @param date String, object or millisencond number of the date
5
+ * @returns updated Date object
6
+ */
7
+ export declare function getDateByTimezoneOffset(date: string | Date | number, offset?: number | string): Date;
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getDateByTimezoneOffset = void 0;
4
+ const ISOToNumericOffset_1 = require("../adapters/ISOToNumericOffset");
5
+ const DATE_FORMAT_1 = require("../constants/DATE_FORMAT");
6
+ const isValidPotentialDate_1 = require("./isValidPotentialDate");
7
+ const validateDate_1 = require("./validateDate");
8
+ /**
9
+ * Gets a Date with the given offset of the Timezone.
10
+ * No given an offset the default is going to be set by the browser
11
+ * @param date String, object or millisencond number of the date
12
+ * @returns updated Date object
13
+ */
14
+ function getDateByTimezoneOffset(date, offset) {
15
+ if (!(0, isValidPotentialDate_1.isValidPotentialDate)(date) ||
16
+ (typeof date === "string" && !(0, validateDate_1.validateDate)(date, DATE_FORMAT_1.DATE_FORMAT.DAY)))
17
+ return date;
18
+ const dt = new Date(date.valueOf());
19
+ const newOffset = (0, ISOToNumericOffset_1.ISOToNumericOffset)(offset);
20
+ return new Date(+dt + newOffset * 1000 * 60);
21
+ }
22
+ exports.getDateByTimezoneOffset = getDateByTimezoneOffset;
@@ -0,0 +1,10 @@
1
+ import { IDataset } from "../../qrvey/interfaces/IDataset";
2
+ import { IModel } from "../../qrvey/interfaces/IModel";
3
+ import { IDTimezone } from "../interfaces/IDTimezone";
4
+ /**
5
+ * Gets the timezone object by the given argument or the model object
6
+ * @param {IDTimezone} timezone the timezone object
7
+ * @param {IModel | IDataset} model the info of the dataset (model)
8
+ * @returns a new timezone object
9
+ */
10
+ export declare function getTimezoneObject(timezone: IDTimezone, model: IModel | IDataset): IDTimezone;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getTimezoneObject = void 0;
4
+ const TIMEZONE_TYPE_1 = require("../constants/TIMEZONE_TYPE");
5
+ const getTimezoneOffsetByType_1 = require("./getTimezoneOffsetByType");
6
+ /**
7
+ * Gets the timezone object by the given argument or the model object
8
+ * @param {IDTimezone} timezone the timezone object
9
+ * @param {IModel | IDataset} model the info of the dataset (model)
10
+ * @returns a new timezone object
11
+ */
12
+ function getTimezoneObject(timezone, model) {
13
+ var _a, _b;
14
+ const offset = (timezone === null || timezone === void 0 ? void 0 : timezone.offset) || ((_a = model === null || model === void 0 ? void 0 : model.timezone) === null || _a === void 0 ? void 0 : _a.offset) || "+00:00";
15
+ const type = (timezone === null || timezone === void 0 ? void 0 : timezone.type) || ((_b = model === null || model === void 0 ? void 0 : model.timezone) === null || _b === void 0 ? void 0 : _b.type) || TIMEZONE_TYPE_1.TIMEZONE_TYPE.DEFAULT;
16
+ return {
17
+ offset: (0, getTimezoneOffsetByType_1.getTimezoneOffsetByType)({ offset, type }),
18
+ type,
19
+ };
20
+ }
21
+ exports.getTimezoneObject = getTimezoneObject;
@@ -0,0 +1,13 @@
1
+ import { IBTimezone } from "../interfaces/IBTimezone";
2
+ import { IDTimezone } from "../interfaces/IDTimezone";
3
+ import { IDTimezoneOffset } from "../interfaces/IDTimezoneOffset";
4
+ /**
5
+ * Gets the timezone offset by the timezone type.
6
+ * For browser types, it is calculated by a Date instance
7
+ * Default types is UTC-0
8
+ * Undefined or Fixed types is gotten by the offset property
9
+ * @param {IDTimezoneType} type the timezone type
10
+ * @param {IDTimezone | IBTimezone} timezone the timezone object
11
+ * @returns {IDTimezoneOffset} the offset of the timezone
12
+ */
13
+ export declare function getTimezoneOffsetByType(timezone: IDTimezone | IBTimezone): IDTimezoneOffset;
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getTimezoneOffsetByType = void 0;
4
+ const isEmpty_1 = require("../../general/mix/isEmpty");
5
+ const numericOffsetToISO_1 = require("../adapters/numericOffsetToISO");
6
+ const TIMEZONE_TYPE_1 = require("../constants/TIMEZONE_TYPE");
7
+ /**
8
+ * Gets the timezone offset by the timezone type.
9
+ * For browser types, it is calculated by a Date instance
10
+ * Default types is UTC-0
11
+ * Undefined or Fixed types is gotten by the offset property
12
+ * @param {IDTimezoneType} type the timezone type
13
+ * @param {IDTimezone | IBTimezone} timezone the timezone object
14
+ * @returns {IDTimezoneOffset} the offset of the timezone
15
+ */
16
+ function getTimezoneOffsetByType(timezone) {
17
+ if ((0, isEmpty_1.isEmpty)(timezone))
18
+ return "+00:00";
19
+ if (timezone.type === TIMEZONE_TYPE_1.TIMEZONE_TYPE.BROWSER) {
20
+ return (0, numericOffsetToISO_1.numericOffsetToISO)("browser");
21
+ }
22
+ else if (timezone.type === TIMEZONE_TYPE_1.TIMEZONE_TYPE.DEFAULT) {
23
+ return "+00:00";
24
+ }
25
+ return timezone.offset || timezone.numericOffset || "+00:00";
26
+ }
27
+ exports.getTimezoneOffsetByType = getTimezoneOffsetByType;