Search

@vladG brilliant, thanks! :D

I pushed the fix – hope that solves it.

I've got an issue where no matter what date I select, as soon as I save the entry, it returns to today's date. Any ideas?

Edit: sorry, turns out my region settings were weird in config.php. Sorted, now.

@Nils I'm currently using date-time as my field for any date-time related stuff. Including article publication dates.

I've got a spec requesting future-dated articles (pretty easy so far) I just create a filter earlier then {$today} {$current-time} and anything older then a minute gets published.

However I've been requested to do a 'preview' feature. Before I used to have a draft checkbox; and the trick was to edit the filter with a url-parameter. so I would do the filter yes, {$url-draft} and in the url to the page I would just append ?draft=no matching both published & unpublished article.

I was wondering weather I could use a url-parameter to fake the filter and display all articles anyway. I can edit the data-source in php but if there's a more elegant way to do it I'd like to use it :)

Things that come into my mind:

  • You could just modify the Data Source file and unset your date filter, when a certain URL parameter is set.
  • You could set a custom date via the URL, like earlier than {$url-publishdate: today}.

By the way, there is no need to write earlier than {$today} {$current-item}, just use earlier than now.

ah yes; right if I had to use earlier than {$url-publishdate: now} and have $url-publishdate resolving to something like 2020 everything works fine.

For some funny reason it didn't cross my mind to use now which makes the filter possible thanks Nils

Even though I have a Date and Time field as required, I can publish without any dates. (Date and Time 3.0.6 with Symphony 2.3.1)

Thanks for reporting.

I'm having some trouble using the filters.

What I'm trying to achieve is showing all entries with date ranges including today or future (anything not past already). Then I also need to filter by specific dates that the user can select.

What I've tried using:

start: equal to or earlier than {$url-datefrom} + end: equal to or later than {$url-dateto: now}

end: equal to or later than now, start: equal to or earlier than {$url-datefrom} + end: equal to or later than {$url-dateto}

end: equal to or later than now, (start: equal to or earlier than {$url-datefrom} + end: equal to or later than {$url-dateto})

But I get

    <error>Illegal string offset 'mode'</error>

Which dates are passed with $url-datefrom, $url-date-from, $url-date-to and $url-dateto?

Sorry there should only be $url-datefrom and $url-dateto.

I've tried many dates, e.g. ?datefrom=2013-03-24&dateto=2013-03-27 which should give entries that have a date range that contains the specified dates, e.g. start 2013-03-01 end 2013-05-01

I'm basically looking for a "contains" kind of filter.

So you define your range in the URL and want to return all entries within this range? Doesn't {$url-datefrom} to {$url-dateto} work in this case?

I want to get the entries that contain the range, not the entries that fit in the range. Think of a reservation system where a venue is available Jan-May, and I am checking whether a reservation can be made Feb-Mar. The filter {$url-datefrom} to {$url-dateto} would only return entries within Feb-Mar, so something available Jan-May would not appear.

The problem may just be occurring because the plus + delimiter in data source filters no longer works (Github issue)

I'm have a little problem with Filtering an "availability" datasource for a hotel: I want to filter the records of the rooms between check-in and check-out date.

This works perfect when i manually put the time of the datefield to 00:00, but when i leave it automatically, it seems to be filtering also the time: Example: Check-in 10/04/2013 11:00pm (time part is automatically added) Availability entry has 10/04/2013 10:00am. So it being filtered also with the time, I only need by date.. Can i desactivate this somewhere?

My filter: equal to or later than {$ds-dssearch.check-in} + earlier than {$ds-dssearch.check-out}

Have you tried deactivating times in the field settings?

The filter {$url-datefrom} to {$url-dateto} would only return entries within Feb-Mar, so something available Jan-May would not appear.

Have you tested that? This should just work.

hi all,

can i select all entries where the date/time field has a range that hits a given date or is empty.

basically:

start: equal to or earlier than {$today} + end: equal to or later than {$today}, regexp: null

@azzagazz: No. I also want to do this (look above). Basically, I'm doing a reservation system where I need to check the availability. I also really need this, so I'm going to investigate and see if I can get it to work.

Is it not possible to combine a year-filter with a word-based filter like: earlier than now + 2013 in order to get all the entries in the past limited to this year? The output currently includes future entries as well. I’m confused.

@animaux: Have you tried something like earlier than now + later than 2012-12-31

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details