Skip to content

Commit

Permalink
Merge pull request #716 from eea/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
Urkorue authored Feb 21, 2025
2 parents e4f63c9 + 0163580 commit a1c7c6f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ All notable changes to this project will be documented in this file. Dates are d

Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

### [1.1.214](https://github.com/eea/volto-clms-theme/compare/1.1.213...1.1.214) - 21 February 2025

### [1.1.213](https://github.com/eea/volto-clms-theme/compare/1.1.212...1.1.213) - 20 February 2025

#### :bug: Bug Fixes
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eeacms/volto-clms-theme",
"version": "1.1.213",
"version": "1.1.214",
"description": "volto-clms-theme: Volto theme for CLMS site",
"main": "src/index.js",
"author": "CodeSyntax for the European Environment Agency",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,13 @@ export const TimeseriesPicker = (props) => {
: null,
);
const [isOpen, setIsOpen] = useState(false);
const [datesApplied, setDatesApplied] = useState(false);

const isValidDateRange = ({ start, end, limit }) => {
/* Calculate if the difference in days is smaller than the allowed limit */
const oneDay = 24 * 60 * 60 * 1000; // hours*minutes*seconds*milliseconds
const diffDays = Math.round(Math.abs((start - end) / oneDay));
return diffDays < limit;
return diffDays <= limit;
};
const dates_array = data_arrays?.map((e) => new Date(e));
return (
Expand Down Expand Up @@ -61,7 +62,7 @@ export const TimeseriesPicker = (props) => {
<Icon name={calendarSVG} size={25} />
<br />
<span>
{item.TemporalFilter
{item.TemporalFilter && datesApplied
? `${cclDateFormat(
item.TemporalFilter.StartDate,
)}-${cclDateFormat(item.TemporalFilter.EndDate)}`
Expand Down Expand Up @@ -202,6 +203,7 @@ export const TimeseriesPicker = (props) => {
StartDate: startValue,
EndDate: endValue,
});
setDatesApplied(true);
setIsOpen(false);
}}
>
Expand Down

0 comments on commit a1c7c6f

Please sign in to comment.