@eeacms/volto-clms-theme 1.1.264 → 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,10 @@ 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
|
+
|
|
9
|
+
### [1.1.265](https://github.com/eea/volto-clms-theme/compare/1.1.264...1.1.265) - 11 December 2025
|
|
10
|
+
|
|
7
11
|
### [1.1.264](https://github.com/eea/volto-clms-theme/compare/1.1.263...1.1.264) - 11 December 2025
|
|
8
12
|
|
|
9
13
|
### [1.1.263](https://github.com/eea/volto-clms-theme/compare/1.1.262...1.1.263) - 10 December 2025
|
package/package.json
CHANGED
|
@@ -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(
|
|
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(
|
|
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
|
-
? `${
|
|
65
|
+
? `${cclDateFormat(
|
|
69
66
|
item.TemporalFilter.StartDate,
|
|
70
|
-
)}-${
|
|
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
|
-
{
|
|
128
|
+
{cclDateFormat(item?.TemporalFilter?.StartDate)} -{' '}
|
|
132
129
|
{item?.TemporalFilter?.EndDate &&
|
|
133
|
-
|
|
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:
|
|
199
|
-
EndDate:
|
|
195
|
+
StartDate: startValue,
|
|
196
|
+
EndDate: endValue,
|
|
200
197
|
};
|
|
201
198
|
setTimeseriesValue(item.unique_id, {
|
|
202
|
-
StartDate:
|
|
203
|
-
EndDate:
|
|
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
|
-
|
|
65
|
-
|
|
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,26 +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
|
-
// Adjust for timezone offset to get the intended UTC date
|
|
66
|
-
const offsetDate = new Date(
|
|
67
|
-
date.getTime() - date.getTimezoneOffset() * 60000,
|
|
68
|
-
);
|
|
69
|
-
|
|
70
|
-
if (isEndOfDay) {
|
|
71
|
-
offsetDate.setUTCHours(23, 59, 59, 999);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
return offsetDate.getTime();
|
|
75
|
-
};
|