Make exposed date filter operators terminology friendly to non-technical website visitors

Created on 19 March 2015, over 10 years ago
Updated 13 June 2025, 3 months ago

In Drupal 8 beta 7

1. Go to /admin/structure/views/view/content
2. Under Filter Criteria, click Add
3. Check Content: Changed
4. Click Apply (all displays)
5. Check Expose this filter

Steps 6-9 necessary until #2248223: Adding a new Views filter and making it exposed returns user back to list of filters โ†’ is fixed:
6. Click cancel
7. Under Filters, look at Content: Changed (= )
8. Under Filters, click Content: Changed (= )
9. Check Expose this filter

10. Check Expose Operator
11. Click Apply
12. Save the view
13. Go to /admin/content
14. Click the dropdown

Actual: Operators read:

Is less than
Is less than or equal to
Is equal to
Is not equal to
Is greater than or equal to
Is greater than
Is between
Is not between
Regular expression
Is empty (NULL)
Is not empty (NOT NULL)

Such language, while technically correct, is not the language the average person would use when talking about dates.

Expected: Operators read (for dates with day, month, or year granularity):

Is before
Is on or before
Is on
Is not on
Is on or after
Is after
Is between
Is not between
Regular expression
Is not present
Is present

Expected: Operators read (for dates with hour, minute, or second granularity):

Is before
Is at or before
Is at
Is not at
Is at or after
Is after
Is between
Is not between
Regular expression
Is not present
Is present

(Filing a separate issue re ability to hide particular operators.)

โœจ Feature request
Status

Postponed: needs info

Version

11.0 ๐Ÿ”ฅ

Component

views.module

Created by

๐Ÿ‡บ๐Ÿ‡ธUnited States charles belov San Francisco, CA, US

Live updates comments and jobs are added and updated live.
  • stale-issue-cleanup

    To track issues in the developing policy for closing stale issues, [Policy, no patch] closing older issues

Sign in to follow issues

Merge Requests

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

    Thank you for sharing your idea for improving Drupal.

    We are working to decide if this proposal meets the Criteria for evaluating proposed changes. There hasn't been any discussion here for over 8 years which suggests that this has either been implemented or there is no community support. Your thoughts on this will allow a decision to be made.

    Since we need more information to move forward with this issue, the status is now Postponed (maintainer needs more info). If we don't receive additional information to help with the issue, it may be closed after three months.

    Thanks!

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States charles belov San Francisco, CA, US

    Updated to Drupal 11.2.x. Still relevant.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    Thanks!

    Will most likely need an issue summary update

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States charles belov San Francisco, CA, US

    I actually did update the summary. Is there anything else you need?

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States charles belov San Francisco, CA, US
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    Thereโ€™s a standard issue template when you create new issues.

    I donโ€™t believe it was around when this ticket was created

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States charles belov San Francisco, CA, US
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States charles belov San Francisco, CA, US

    Updating issue to follow current template.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States charles belov San Francisco, CA, US
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States charles belov San Francisco, CA, US
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia junaidpv Kannur, Kerala

    This to be solved still after the long 10 years since started this ticket.

    Granularity option is already discussed and developed at โœจ [PP-1] Views Date Filter Datetime Granularity Option Postponed . No need to address that here.

    Here the patch just addressing the issue about the operator labels.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    thanks but fixes should be in MRs now

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia junaidpv Kannur, Kerala

    junaidpv โ†’ changed the visibility of the branch 2455971-friendly-exposed-operator-labels to hidden.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia junaidpv Kannur, Kerala

    junaidpv โ†’ changed the visibility of the branch 2455971-friendly-exposed-operator-labels to hidden.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia junaidpv Kannur, Kerala

    junaidpv โ†’ changed the visibility of the branch 2455971-friendly-exposed-operator-labels to active.

  • Pipeline finished with Failed
    about 1 month ago
    Total: 165s
    #564493
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia junaidpv Kannur, Kerala

    Created an MR with a new more change to change labels for range fields from "Min" to "From" and "Max" to "To".

    Here that in patch form for 10.5.x. To help composer based build process we use.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave
  • Status changed to Needs work about 1 month ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States charles belov San Francisco, CA, US

    @junaidpv Thank you for the patch. Aside from the testing issue raised by @smustgrave, it gets us much of the way there.

    The drop-down works, substituting the English-friendly terms on all pages.

    In the view preview and the view page, I do see From and To.

    I don't know whether it is feasible, but in the Views UI itself, we still get the technical labels. It would be nice is those were plain English as well:
    Min
    Max
    Min placeholder
    Max placeholder

  • First commit to issue fork.
  • Pipeline finished with Failed
    24 days ago
    Total: 149s
    #579984
  • Pipeline finished with Failed
    24 days ago
    Total: 232s
    #579997
  • Pipeline finished with Canceled
    24 days ago
    Total: 130s
    #579998
  • Pipeline finished with Failed
    24 days ago
    Total: 2478s
    #579999
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom oily Greater London

    Added test coverage, two asserts on 2 lines. Hoped for a quick win.

    I would create a separate test but I don't understand why those asserts do not provide the coverage needed (yet). So not convinced that breaking it out into a separate test would make any difference.

    Hopefully those asserts are right at least?

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom oily Greater London

    Studying the test code in relation to this issue did make me see that the names of the relevant fields have 'min' and 'max' suffixes. And perhaps other metadata also uses 'min' and 'max' so we are creating a disconnect between 'from' and 'to' and the metadata? So perhaps we can change one or two of the field names to reflect 'from' and 'to'? And/or add code comments to explain the new mapping of 'min' to 'from' etc?

Production build 0.71.5 2024