@eeacms/volto-clms-theme 1.1.265 → 1.1.267
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.267](https://github.com/eea/volto-clms-theme/compare/1.1.266...1.1.267) - 16 December 2025
|
|
8
|
+
|
|
9
|
+
### [1.1.266](https://github.com/eea/volto-clms-theme/compare/1.1.265...1.1.266) - 11 December 2025
|
|
10
|
+
|
|
7
11
|
### [1.1.265](https://github.com/eea/volto-clms-theme/compare/1.1.264...1.1.265) - 11 December 2025
|
|
8
12
|
|
|
9
13
|
### [1.1.264](https://github.com/eea/volto-clms-theme/compare/1.1.263...1.1.264) - 11 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,16 +18,27 @@ 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);
|
|
33
30
|
|
|
31
|
+
const toISOIgnoreTimezone = (inputDate) => {
|
|
32
|
+
return (
|
|
33
|
+
inputDate.getFullYear() +
|
|
34
|
+
'-' +
|
|
35
|
+
('0' + (inputDate.getMonth() + 1)).slice(-2) +
|
|
36
|
+
'-' +
|
|
37
|
+
('0' + inputDate.getDate()).slice(-2) +
|
|
38
|
+
'T00:00:00.000Z'
|
|
39
|
+
);
|
|
40
|
+
};
|
|
41
|
+
|
|
34
42
|
const isValidDateRange = ({ start, end, limit }) => {
|
|
35
43
|
/* Calculate if the difference in days is smaller than the allowed limit */
|
|
36
44
|
const oneDay = 24 * 60 * 60 * 1000; // hours*minutes*seconds*milliseconds
|
|
@@ -65,9 +73,9 @@ export const TimeseriesPicker = (props) => {
|
|
|
65
73
|
<br />
|
|
66
74
|
<span>
|
|
67
75
|
{item.TemporalFilter
|
|
68
|
-
? `${
|
|
76
|
+
? `${cclDateFormat(
|
|
69
77
|
item.TemporalFilter.StartDate,
|
|
70
|
-
)}-${
|
|
78
|
+
)}-${cclDateFormat(item.TemporalFilter.EndDate)}`
|
|
71
79
|
: 'Select dates'}
|
|
72
80
|
</span>
|
|
73
81
|
</button>
|
|
@@ -124,13 +132,14 @@ export const TimeseriesPicker = (props) => {
|
|
|
124
132
|
download_limit_temporal_extent < 180 ? dates_array : null
|
|
125
133
|
}
|
|
126
134
|
disabledKeyboardNavigation
|
|
135
|
+
timeZone="UTC"
|
|
127
136
|
>
|
|
128
137
|
{(item?.TemporalFilter?.StartDate ||
|
|
129
138
|
item?.TemporalFilter?.EndDate) && (
|
|
130
139
|
<span>
|
|
131
|
-
{
|
|
140
|
+
{cclDateFormat(item?.TemporalFilter?.StartDate)} -{' '}
|
|
132
141
|
{item?.TemporalFilter?.EndDate &&
|
|
133
|
-
|
|
142
|
+
cclDateFormat(item?.TemporalFilter?.EndDate)}
|
|
134
143
|
</span>
|
|
135
144
|
)}
|
|
136
145
|
<br />
|
|
@@ -195,12 +204,12 @@ export const TimeseriesPicker = (props) => {
|
|
|
195
204
|
}
|
|
196
205
|
onClick={() => {
|
|
197
206
|
item.TemporalFilter = {
|
|
198
|
-
StartDate:
|
|
199
|
-
EndDate:
|
|
207
|
+
StartDate: toISOIgnoreTimezone(startValue),
|
|
208
|
+
EndDate: toISOIgnoreTimezone(endValue),
|
|
200
209
|
};
|
|
201
210
|
setTimeseriesValue(item.unique_id, {
|
|
202
|
-
StartDate:
|
|
203
|
-
EndDate:
|
|
211
|
+
StartDate: toISOIgnoreTimezone(startValue),
|
|
212
|
+
EndDate: toISOIgnoreTimezone(endValue),
|
|
204
213
|
});
|
|
205
214
|
setIsOpen(false);
|
|
206
215
|
}}
|
|
@@ -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,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
|
-
};
|