Search

Date and Time updated to version 1.5.1 on 22nd of November 2010

  • Section Schema compatibility. (Thanks, Brendan!)

Is there any reason data source filtering by a parameter such as {$today} wouldn’t work? I have the language set to English and the field format set to MMMM d yyyy, HH:mm on a new Symphony 2.1.2 installation running locally on my Mac under MAMP.

{$this-year}-{$this-month} or manually entering a year and month like 2010-12 into the DS filter will work fine. But using {$today} or even manually entering a date like 2010-12-21 will return no results even when there are entries that have that date. Are there any system settings or formatting issues that I am missing?

Simple answer: it’s a bug. I noted it for the next release.

Ah ha! Thanks for the quick reply. I’m glad that I wasn’t just missing something totally obvious.

Just want to say that implement the Next Previous article filtering with this field is as easy as pie. I was having trouble with the default date field, but this is just amazing.

Thanks Nils :)

Curious, what is the field doing to help in that matter?!

I’m not sure I got your question right but… filtering by earlier than and later than with the default date field is not as accurate as this. However, I was just impressed how easy it is to accomplish the next/previous task without having to hardcode anything. Awesome!

@rheingolden Try just today. At heart this maps to the php’s strtotime function, so it’s not really necessary to use the Symphony params here.

@brendo “earlier than today” and “later than today” seem to be working fine, thanks for the tip.

Is there a built in syntax or other filtering method for if you have two dates specified in the field to check and see if “today” falls between the first and second date? For example, to be able set a publishing schedule for when an article appears on the site and then expires from the site?

Yeah we just recently had to do this for work. If you pull the latest from github there are some commits that will allow you to do the following:

earlier than today %2B 6 weeks, later than today - 6 weeks

Which gets all entries in a 6 week window.

Note that you must urlencode + signs to get around the Symphony convention.

Edit: Removed my moronic question.

Is there any reason why this field doesn’t have the option of making it required? Could it be easily added? I’m using it in a form for booking a service at a specific date, and submitting the form without setting a date doesn’t make sense.

I was asking myself this question only last week. I’m working on a new version that removes this limitations. Changing this line to true should help in the meantime.

@nils

I found a bug. It’s posted on the issue tracker. When selecting Date/Time field as Data Source output parameter, Symphony crashes in field.datetime.php at line 727.

@alpacaaa

How did you exactly filter for Previous / Next article problem?

If have an issue with DS Output parameter as Date/Time field.

This extension is just what I was after, though I had one question. Is there an easy way to hide the start/end part of the field (it can default to 00:00)? I only need the field for specific days, the time isn’t necessary

Currently there is no such option. But I’m working on an update to make this extension Symphony 2.2 compatible where this could easily be added. (Although I have to add that I’m quite busy with other projects and there is no scheduled release date for version 2.0 yet.)

Thanks for the reply Nils, it’s not a problem since it can just be ignored. I was wondering if I was missing something obvious :)

@vladG

In your single article/post/whatever datasource use as parameter output Date and Time field. Then create two datasources, for next and previous articles. In next article ds filter by date and time with this value: later than {$ds-single-article}. In previous article ds filter by earlier than {$ds-single-article}.

Replace $ds-single-article with the correct output parameter and limit each datasource to 1 entry.

I found I was getting a Symphony Fatal Database Error when leaving the field blank (pre-populate turned off). I tried manually editing the extension to make it required but still got the error.

Now that I’ve set it to prepopulate the error no longer occurs if the field isn’t touched, but I was wondering if there’s a way to change the prepoulate date somewhere in the extension files?

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