-
Notifications
You must be signed in to change notification settings - Fork 33
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
Filtering confusion #135
Comments
What about |
Doesn't work :( |
I've had a good old look through the filtering for this field, and there's nothing wrong there. The problem is that the user is not selecting an end date, yet one is being stored in the field's table. This doesn't sound right to me. As the filters are using default start and end dates of
then shouldn't the default end date be applied to the field in absence of a selected one? That way all filtering attempts would work correctly as expected in all variations, when an end date is not specified. |
Line 625 of What do you think Nils? |
Ah, but this makes the calendar select the entire future. Damn. |
Have you tried |
I will, that one really confused me. Does |
This is correct behaviour: If you select only a single date, you are specifying an exact moment in time thus start and end should be the same (which is why the field stores the start as end as well).
I never used the |
I've actually decided to change to having two separate fields for this, as I just can't get it to work. Now I have the problem that I can filter the from field perfectly, but if I add no date into the to field, and specify a filter, it returns no results, as the field has no date in it. I'm really at a loss as to how to achieve this, no solution works here. |
Your posts don't really give me a clue. |
I need to allow a user to add a date to publish from, and optionally add a date to un-publish the entry. The from date is no issue at all. However I try and do the un-publish date, whether it be a range from The range filtering only works if there are two values, as not specifying an end date adds the start as the end too, which means the entry will never display as the end has already passed. Single field range I would expect to work with optional end date (works with a future end date):
Single field dates I would expect to work:
The filters that make this scenario fail are: |
So, it seems that I would like to re-write the explanation for you as it doesn't read like that for me. Sorry for wasting your time @nilshoerrmann you know I appreciate your help though o_O |
No worries, John. I have neither added nor used the |
John, I've been thinking about your problem over the last days and maybe the syntax should be adjusted and extended to ease filtering. What about this? Filter KeywordsIn addition to the filter keywords inherited from the core date field (
These keywords could be connected to other relative date filters using Filter PrefixesThe filter prefixes could be simplified:
The latter replaces the current So your desired filtering could be written like this:
(Not sure about the placement of the
What do you think? |
Maybe it would even be better to rename
So the prefixes would become simple keywords like /cc @brendo |
Any comments by you on this proposal, @designermonkey and @brendo? |
It'd be very cool. I'm fortunate to have never needed very complex date filtering but for those who do I'm sure it'd be welcomed. I wonder how much of this natural language PHP can already parse? |
What about renaming or removing the keywords |
You'd need them for backwards compatibility, but aside from start:, |
Personally, I'd think of this as a breaking change (= version 4.0) not offering backwards compatibility.
I don't know – the problem is that this needs to be transformed into a MySQL query, so I'm not sure how PHP will help here … |
I am trying to allow a date range for publishing an entry. The user can enter the publish dates as a single from date, or select a range to start and end.
If the user doesn't select and end date, then the same dat that was chosen for the start is stored in the field.
This breaks filtering as I can't do
start: earlier than now + end: later than now
being thatend
is the same asstart
.I'd rather not have two date boxes to allow a start and end date selection for filtering. Am I doing something wrong here?
The text was updated successfully, but these errors were encountered: