Search

I am working on the French translations, will push you that soon

Edit: pull request was send

@animaux: If you are using the release candidate of version 2.0 you should be able to filter by this:

today - 1 year to today The extension recognizes all relative dates known to PHP's DateTime object.

@nils (and others of course) How does the filter behave when there a several dates in a datetime field? For example: if I have several dates in a field, and I want to check if the most recent date is not older than 7 weeks. Is this possible?

No, that's not possible. The extension always takes all given dates into account. These are the options you have so far:

Data Source Filtering

Version 2.0 introduces new filter options in the data source editor:

  • prefixing a filter with start: will only check start dates,
  • prefixing a filter with end: will only check end dates,
  • prefixing a filter with strict: will check, if start and end date are in the given filter range,
  • filters without prefixes will check, if start or end date are in the given filter range.

Filters separated by comma will find all dates that match one of the given dates or ranges.
Filters separated by + will only find dates that match all of the given dates or ranges.

This extensions accepts all relative dates known to PHP's DateTime class for filtering. It also allows the creation of filter ranges with to or earlier than and later than.

@nils thanks! … sorry, should have rtfm *cough*

To give you some background:

Each date you add to an entry is saved as a single entry in the database. So if the date or date range is processed by the data source, the extension does only know about that one date – there is no context information that would allow the kind of filtering you're after.

So you might have multiple start and end dates per entries: each attached date consists of one start and one end date.

Good to know!

I guess it isn’t possible to include data from other fields in the data source for calculation? Like:

later than today - ($day-interval * ($number-of-repeats - 1))

(I have a section that has a date, and two input fields to make repeating dates with custom possible. These are currently only used in frontend display, but would be useful for filtering too. (The repeating date extension didn’t work for me, since I needed date ranges plus repeating dates.) What I’m trying to achieve is to output only dates that have at least one of the repeated dates still in the future.)

animaux, that could be possible to do with Reflection field, once someone implements support for date and time for it.

@ahwayakchih looks promising, thanks! will look for a workaround in the meantime :)

Hi Nils ! I have a problem filtering with your super calendar.

The deal is this. We use your calendar for storing a start date (mandatory) and a end date (not- mandatory). I want the DS to return all entries that matches

1- today between start and end (which works)
OR
2- start is before today and end IS NULL

I tired different filtering patterns

  • today
  • today, start:today
  • today, start:today + end:null
  • today, start:today + end:is null

no luck each time... can you help me on this ? I thought of adding another prefix to your code but I wanted to check if this code be done without coding...

Thanks man.

If you want to check for dates before today, you'd have to use something along these lines:

start: earlier than today

But there is no option to check for empty end dates.

@Nils: I am afraid that "start: earlier than today" will match entries that have a ending date in past as well...

I try to fork you and add the null check... are date field really NULL in the DB ?

Thanks

EDIT: no they are not null but start = end

I added a new filtering option, softrange, which is exactly the same as range except that it will returns entry that matches range or has a past start and the start = end. I'll send a pull request

I'm trying to store dates as dd/mm/yyy - 01/07/2011, which I have specified in the config, yet the XML always displays

            <date timeline="1" type="exact">
                <start iso="2011-01-07T00:00:00+00:00" time="00:00" weekday="5" offset="+0000">2011-01-07</start>
            </date>

Is this right? If I have the ISO date format saved then why is my formatted date not what I specified in my config file?

This causes me a great problem as I've specified the date to be dd/mm/yyyy as this is how my data is that I'm trying to import, yet I can't import it as the date time field isn't reflecting the config setting correctly.

How can I go about changing this?

So there seems to be a larger problem here. I input (via the calendar) 1st July 2011, formatted as dd/mm/yyyy as per config.php. When I hit save, it switches the day and month over, every time I subsequently hit save, it switches again.

The problem doesn't seem to be just this field though. The core date field is behaving odd too. The same happens, although it only switches the day and month round on the first save.

This is a class.datetimeobj.php bug @ line 135, so I'm logging it.

The output in the XML is by convention because this is how all XSL utilities expect the date object. How is the XML output related to your import?!

Ok Nils, I assumed it would use the format from config.php. I'll continue the discussion about the bug on the issue tracker.

Is there a way to filter the datasource by datetime by year, e.g 2011? It seems that only the whole value get's accepted e.g 2011-07-14

How can I use the output in my XSL?

Say I got a variable $date that is 2011-07-15. I want my XSL to display an event that has a range of 2011-07-12 till 2011-07-19. How would my XPath or XSL logic look like in this case?

You could transform the dates to numbers with something like number(translate(your/date, '-', '')) and compare the start and end date with the given date. Or you could probably use some EXSLT date functions.

Have you filtered your DS accordingly?

Have you filtered your DS accordingly?

Or that :-)

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