Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to select quick date ranges for date filter fields in Filter Layer tool #9915

Closed
2 tasks
dsuren1 opened this issue Jan 25, 2024 · 0 comments · Fixed by #9951, #10301 or #10307
Closed
2 tasks

Ability to select quick date ranges for date filter fields in Filter Layer tool #9915

dsuren1 opened this issue Jan 25, 2024 · 0 comments · Fixed by #9951, #10301 or #10307

Comments

@dsuren1
Copy link
Contributor

dsuren1 commented Jan 25, 2024

Description

In the Filter Layer tool, it would be useful to have the ability to set predefined ranges

image

Acceptance criteria

  • The date/date-time components should use the latest component
  • The plugin configuration property is as follows
    The configuration property name is quickDateTimeSelectors and holds array of objects with type, value and label will hold the custom label for each quick selector
    {
      "quickDateTimeSelectors": [{
          "type": "date/date-time",
          "value": "DATE_EXPRESSION", // check the expression above
          "label": "CUSTOM_LABEL" // custom button label
      }]
    }
    value is in ISO 8601 format

Note

Template

isoFormat: P[n]Y[n]M[n]DT[n]H[n]M[n]S / P[n]W (refer Durations)
dateExpression: {now}[+/-]${isoFormat}, where {now} is a placeholder to add current date-time based on field type(optional for single), + adds date/time and - subtracts date/time
supportable placeholders - now, today, thisWeekStart | thisWeekEnd, thisMonthStart | thisMonthEnd, thisYearStart | thisYearEnd (except now, today other placeholders are a nice to have feature)
single - {dateExpression}
range - {dateExpression}/{dateExpression} (valid - end date > start date). / delimiter denotes range value

date - start time is always 00:00:00
date-time will treat 00:00:00 as start and 23.59:00 as end time

Example

  • single - {today}-P1D - Yesterday (date), {now}+P0D - Today (date-time), {now}+P7D - 7 days from now (date-time), {today}+P2M3D - 2 months and 3 days from now (date).
  • range - {now}/{now}+P5D - now to 5 days from now, {now}/PT5M - now to 5mins from now (date-time), {today}/{today}+P5D - today to 5 days from today

Defaults and options

For intervals date:

  • Today, This week, This month, 7, 30, 90 days from now

For intervals date-time:

  • Now, This week, This month, 7, 30, 90 days from now

For single dates:

  • Today, Yesterday, Tomorrow

For single date-time:

  • Now, Yesterday, Tomorrow

E.g.
image

Other useful information

https://github.com/geosolutions-it/MapStore2-C040/issues/819

@dsuren1 dsuren1 added the New Feature used for new functionalities label Jan 25, 2024
@dsuren1 dsuren1 self-assigned this Jan 25, 2024
@dsuren1 dsuren1 added C040-COMUNE_GE-2023-CUSTOM-SUPPORT enhancement and removed New Feature used for new functionalities labels Jan 25, 2024
@dsuren1 dsuren1 added this to the 2024.01.00 milestone Jan 25, 2024
dsuren1 added a commit to dsuren1/MapStore2 that referenced this issue Feb 2, 2024
@ElenaGallo ElenaGallo self-assigned this Feb 23, 2024
@tdipisa tdipisa linked a pull request May 10, 2024 that will close this issue
12 tasks
@ElenaGallo ElenaGallo linked a pull request May 13, 2024 that will close this issue
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment