Clarify options for 'offset' on date field filters

Created on 3 December 2015, almost 9 years ago
Updated 24 February 2023, over 1 year ago

Currently it says

An offset from the current time such as "+1 day" or "-2 hours -30 minutes"

I guess the available options are what some php function allows, like strtotime(), see here:
http://php.net/manual/de/datetime.formats.relative.php

If that is the case, it would be nice to have that explained, maybe with a link even.

But the above link does not mention the plurals of hour and minute, so i'm not sure.
And i have quite no idea on where to look in the code to find the relevant parts.

PS:
Maybe there's also a typo?
An offset from the current time such as "+1 day" or "-2 hours -30 minutes"
should maybe be
An offset from the current time such as "+1 day" or "-2 hours" or "-30 minutes"
Or is "-2 hours -30 minutes" trying to indicate that calculations can be done too? ( = -1.5 hours)?
That would be a nonsense example ;-)

πŸ“Œ Task
Status

Closed: won't fix

Version

9.5

Component
Views UIΒ  β†’

Last updated 9 days ago

Created by

πŸ‡¨πŸ‡­Switzerland sirtet Switzerland

Live updates comments and jobs are added and updated live.
  • Documentation

    Primarily changes documentation, not code. For Drupal core issues, select the Documentation component instead of using this tag. In general, component selection is preferred over tag selection.

  • Usability

    Makes Drupal easier to use. Preferred over UX, D7UX, etc.

  • Needs usability review

    Used to alert the usability topic maintainer(s) that an issue significantly affects (or has the potential to affect) the usability of Drupal, and their signoff is needed. When adding this tag, make it easy to review the issue. Make sure the issue summary describes the problem and the proposed solution. Screenshots usually help a lot! To get sign-off on issues with the "Needs usability review" tag, post about them in the #ux channel on Drupal Slack, and/or attend a UX meeting to demo the patch and get direct feedback from designers/UX folks/product management on next steps. If an issue represents a significant new feature, UI change, or change to the general "user experience" of Drupal, use Needs product manager review instead. See the scope of responsibilities for product managers.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States smustgrave
  • Status changed to RTBC over 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    May not need usability review actually.

    Change is better but not clear now you can do -2 -30 minutes combined now. Will see what the committer thinks.

  • Status changed to Needs review over 1 year ago
  • πŸ‡¬πŸ‡§United Kingdom alexpott πŸ‡ͺπŸ‡ΊπŸŒ

    For me we should close this as "won't fix works as designed". I think the help is useful it is showing you that -2 hours -30 minutes is how to subtract 2 and a half hours using this field. Because -2 hours 30 minutes will only subtract one and a half hours.

  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    +1 for that

  • πŸ‡³πŸ‡±Netherlands Lendude Amsterdam

    Hmm, I think our example here is a little obscure in syntax, even though it might be correct. But as it isn't an uncommon scenario to try and offset by parts of hours, and it has a weird-ish syntax, it does provide value. We might do a better job of explaining what the expected outcome of the value is maybe? If we want to do anything at all?

    Should we close this and tag πŸ› Date/time Views filter tries strotime() relative to Unix epoch Needs work as needing to update these examples? If that lands we might be able to link to strtotime I think?

  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    If we think this won't make it I think moving that over makes sense.

  • Status changed to Closed: won't fix over 1 year ago
  • πŸ‡³πŸ‡±Netherlands Lendude Amsterdam

    Since the docs aren't wrong, moving this to a task.

    Options I see:

    1. Remove the "-2 hours -30 minutes" example since its vague syntax (feels bad since it is a correct example)
    2. Add additional explanation to the "-2 hours -30 minutes" example at to the expected outcome, maybe explain that "-2 hours 30 minutes" does something else (feel over the top)
    3. Update πŸ› Date/time Views filter tries strotime() relative to Unix epoch Needs work to also update the examples provided, or link to strtotime docs (which currently doesn't provide an example like "-2 hours -30 minutes")

    I'm going to implement 3, if somebody feel strongly that we should do another option, feel free to reopen this.

Production build 0.71.5 2024