@eeacms/volto-clms-theme 1.1.265 → 1.1.266

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.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,8 @@ All notable changes to this project will be documented in this file. Dates are d
4
4
 
5
5
  Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
6
6
 
7
+ ### [1.1.266](https://github.com/eea/volto-clms-theme/compare/1.1.265...1.1.266) - 11 December 2025
8
+
7
9
  ### [1.1.265](https://github.com/eea/volto-clms-theme/compare/1.1.264...1.1.265) - 11 December 2025
8
10
 
9
11
  ### [1.1.264](https://github.com/eea/volto-clms-theme/compare/1.1.263...1.1.264) - 11 December 2025
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-clms-theme",
3
- "version": "1.1.265",
3
+ "version": "1.1.266",
4
4
  "description": "volto-clms-theme: Volto theme for CLMS site",
5
5
  "main": "src/index.js",
6
6
  "author": "CodeSyntax for the European Environment Agency",
@@ -4,10 +4,7 @@ import { Grid, Popup } from 'semantic-ui-react';
4
4
  import calendarSVG from '@plone/volto/icons/calendar.svg';
5
5
  import { Icon } from '@plone/volto/components';
6
6
 
7
- import {
8
- cclCartDateFormat,
9
- toUTCTimestamp,
10
- } from '@eeacms/volto-clms-theme/components/CclUtils';
7
+ import { cclDateFormat } from '@eeacms/volto-clms-theme/components/CclUtils';
11
8
  import CclButton from '@eeacms/volto-clms-theme/components/CclButton/CclButton';
12
9
 
13
10
  export const TimeseriesPicker = (props) => {
@@ -21,12 +18,12 @@ export const TimeseriesPicker = (props) => {
21
18
  } = props;
22
19
  const [startValue, setStartValue] = useState(
23
20
  item?.TemporalFilter?.StartDate
24
- ? new Date(cclCartDateFormat(item.TemporalFilter.StartDate))
21
+ ? new Date(cclDateFormat(item.TemporalFilter.StartDate))
25
22
  : null,
26
23
  );
27
24
  const [endValue, setEndValue] = useState(
28
25
  item?.TemporalFilter?.EndDate
29
- ? new Date(cclCartDateFormat(item.TemporalFilter.EndDate))
26
+ ? new Date(cclDateFormat(item.TemporalFilter.EndDate))
30
27
  : null,
31
28
  );
32
29
  const [isOpen, setIsOpen] = useState(false);
@@ -65,9 +62,9 @@ export const TimeseriesPicker = (props) => {
65
62
  <br />
66
63
  <span>
67
64
  {item.TemporalFilter
68
- ? `${cclCartDateFormat(
65
+ ? `${cclDateFormat(
69
66
  item.TemporalFilter.StartDate,
70
- )}-${cclCartDateFormat(item.TemporalFilter.EndDate)}`
67
+ )}-${cclDateFormat(item.TemporalFilter.EndDate)}`
71
68
  : 'Select dates'}
72
69
  </span>
73
70
  </button>
@@ -128,9 +125,9 @@ export const TimeseriesPicker = (props) => {
128
125
  {(item?.TemporalFilter?.StartDate ||
129
126
  item?.TemporalFilter?.EndDate) && (
130
127
  <span>
131
- {cclCartDateFormat(item?.TemporalFilter?.StartDate)} -{' '}
128
+ {cclDateFormat(item?.TemporalFilter?.StartDate)} -{' '}
132
129
  {item?.TemporalFilter?.EndDate &&
133
- cclCartDateFormat(item?.TemporalFilter?.EndDate)}
130
+ cclDateFormat(item?.TemporalFilter?.EndDate)}
134
131
  </span>
135
132
  )}
136
133
  <br />
@@ -195,12 +192,12 @@ export const TimeseriesPicker = (props) => {
195
192
  }
196
193
  onClick={() => {
197
194
  item.TemporalFilter = {
198
- StartDate: toUTCTimestamp(startValue, false),
199
- EndDate: toUTCTimestamp(endValue, true),
195
+ StartDate: startValue,
196
+ EndDate: endValue,
200
197
  };
201
198
  setTimeseriesValue(item.unique_id, {
202
- StartDate: toUTCTimestamp(startValue, false),
203
- EndDate: toUTCTimestamp(endValue, true),
199
+ StartDate: startValue,
200
+ EndDate: endValue,
204
201
  });
205
202
  setIsOpen(false);
206
203
  }}
@@ -61,8 +61,10 @@ export const getDownloadToolPostBody = (selectedItems) => {
61
61
  body_extras['Layer'] = item?.layer;
62
62
  }
63
63
  if (item?.TemporalFilter) {
64
- // TemporalFilter now contains UTC timestamps directly
65
- body_extras['TemporalFilter'] = item.TemporalFilter;
64
+ body_extras['TemporalFilter'] = {
65
+ StartDate: new Date(item?.TemporalFilter?.StartDate).getTime(),
66
+ EndDate: new Date(item?.TemporalFilter?.EndDate).getTime(),
67
+ };
66
68
  }
67
69
  }
68
70
  return { DatasetID: item?.dataset_uid, ...body_extras };
@@ -30,15 +30,6 @@ export const cclDateFormat = (date) => {
30
30
  return `${day}.${month}.${year}`;
31
31
  };
32
32
 
33
- export const cclCartDateFormat = (date) => {
34
- const dateObj = new Date(date);
35
- // Use UTC methods to ensure consistent display regardless of user timezone
36
- const day = ('0' + dateObj.getUTCDate()).slice(-2);
37
- const month = ('0' + (dateObj.getUTCMonth() + 1)).slice(-2);
38
- const year = dateObj.getUTCFullYear();
39
- return `${day}.${month}.${year}`;
40
- };
41
-
42
33
  export const workOpportunitiesCclDateFormat = (date, lang) => {
43
34
  const internal = getInternalValue(date, lang);
44
35
  return internal.format('DD.MM.YYYY');
@@ -50,31 +41,3 @@ export const cclTimeFormat = (date) => {
50
41
  const minutes = ('0' + dateObj.getMinutes()).slice(-2);
51
42
  return `${hours}.${minutes}`;
52
43
  };
53
-
54
- /**
55
- * Convert a Date object to UTC timestamp, preserving the calendar date
56
- * regardless of the user's timezone.
57
- *
58
- * @param {Date} date - The date to convert
59
- * @param {boolean} isEndOfDay - If true, set time to 23:59:59.999, otherwise 00:00:00.000
60
- * @returns {number|null} UTC timestamp in milliseconds, or null if date is falsy
61
- */
62
- export const toUTCTimestamp = (date, isEndOfDay = false) => {
63
- if (!date) return null;
64
-
65
- // Extract local calendar date components
66
- const year = date.getFullYear();
67
- const month = date.getMonth();
68
- const day = date.getDate();
69
-
70
- // Create UTC timestamp for that calendar date
71
- return Date.UTC(
72
- year,
73
- month,
74
- day,
75
- isEndOfDay ? 23 : 0,
76
- isEndOfDay ? 59 : 0,
77
- isEndOfDay ? 59 : 0,
78
- isEndOfDay ? 999 : 0,
79
- );
80
- };
@@ -9,8 +9,6 @@ export {
9
9
  cclDateFormat,
10
10
  cclDateTimeFormat,
11
11
  cclTimeFormat,
12
- cclCartDateFormat,
13
- toUTCTimestamp,
14
12
  } from './dateFormats';
15
13
  export { helmetTitle } from './helmetTitle';
16
14
  export { sanitizedHTML } from './sanitizedHTML';