Search

So did we ever have a solution for when we have a single entry with multiple dates which results in unexpected results in datasources that have limits?

eg. I have an entry that has 4 dates attached to it. The datasource limit is 4. The datasource returns one entry.

hmm .. I'm not able to get this field to be required. I can check the box, but it doesn't produce a entry-creation-halting error. Is this a bug?

That sound definitely like a bug. Could you post this to Github, please? Thanks!

Done !

Nils said use datetime.xsl. Nils, what if i already have standard Symphony's date-time.xsl utility and already use it for some fields? If i create datetime.xsl, won't it work good, cause both utilities have for example same <xsl:template name="format-date">?

Yes, that's a problem. You either have to switch to one of the utilities or adjust one to fit your needs. If you seek date localisation you could still write your own templates based on the provided Data Source.

Nils, if i take data.datetime.php from your extension to workspace/data-sources, will the localisation files work?

As long as you attach the DS to your page and add the utility to the page everything should be fine. The template path/source doesn't matter.

Ok, well can't find how does localisation work in Date and Time, there is no russian, but when i add:

array('ru', 'ruRU.UTF8', 'ruRU')

it show months and days in russian, but i need change their case, and creating lang.ru.php doesn't help

what is this path in the datetime.xsl: /data/datetime/language[@id = $lang]/months/month[@id = $month]

and another "bug":

$weekday - [optional] takes a number (monday = 1, tuesday = 2 ...), defaults to $date/@weekday

but xml is: Sunday MondayTuesdayWednesdayThursdayFridaySaturday

and in front end the "friday" must be saturday, move to 1 day forward, how to solve this problem? in backend it's all ok with calendar

I managed to use this extension in a front-end form by cloning the code in the back-end
All seems to work fine, but now i found out it's not working when not logged in... :(
I broke it down and i think it's this javascript that calls to elements in the back-end?

&lt;script type="text/javascript">Symphony.Context.add('env', {"section_handle":"agenda","page":"new","entry_id":null,"flag":null}); Symphony.Context.add('root', '<xsl:value-of select="$root"/>');&lt;/script>

There's this issue on Github, but that does'nt seem to work for me...
@ nils, please help me! :)

The mentioned script belongs to the Symphony core and I guess you are facing two problems:

  • Date and Time depends on the Symphony.Context.get('root') variable and
  • it makes a call to the backend to parse and validate dates.

You'd have to recreate that functionality outside of the admin interface. It's this file: https://github.com/nilshoerrmann/datetime/blob/master/content/content.get.php

@Nils, thanks for your reply
Seems like a lot of hacking :(
Think i am going to look for another js calendar widget...
anyone suggestions?

It shouldn't be that complicated: you just need to recreate the file mentioned outside of Symphony and make sure that the calendar class and Symphony's DateTimeObj are included. In the JavaScript you'd just have to switch the AJAX call to your own file which will also remove the dependency on Symphony.Context.get('root') which is only used in that context.

I gave it a try

I did like you said and came up with this:

I have copied and moved the files 'content.get.php', 'class.calendar.php' , 'class.datetimeobj.php' and 'class.administrationpage.php' (Do i also need this file?) to my workspace folder;

'content.get.php' now looks like this:

<?php

    /**
     * @package content
     */
    require_once(TOOLKIT . 'class.administrationpage.php');
    require_once(EXTENSIONS . 'class.calendar.php');
    require_once(EXTENSIONS . 'class.datetimeobj.php');

    class contentExtensionDatetimeGet extends AdministrationPage {

        /**
         * Used to fetch subsection items via an AJAX request.
         */
        public function __viewIndex() {
            echo Calendar::formatDate(General::sanitize($_GET['date']), General::sanitize($_GET['time']), NULL, true);
            exit;
        }

    }

?>

In the JavaScript you'd just have to switch the AJAX call to your own file

Where exactly do i need to do this?

@Nils,
Don't worry, i got it working with a jquery calendar widget
Which in my case is a more elegant solution... less code and hacking.
I was only needing a start date, and got the date format matching the date and time field format
thanks anyway!

I've got an article section in which some articles get an expiry date (date/time field) as these can expire (announcements) and most do not (reports).

Now I wish to filter to only get unexpired articles and articles that will never expire.

How can I do this?

I now filter on this 'expiry-date' field with "later than today" but can't find a way to also get the entries with an empty expiry date.

I have been looking for some good documentation on filter options as well...
Am i correct that these functions are php functions?
Anyone knows where i can find some docs on this?

And a happy new year to everyone!

I now filter on this 'expiry-date' field with "later than today" but can't find a way to also get the entries with an empty expiry date.

Hm, that's a good question – I don't think it's possible at the moment, but it should be.

I have been looking for some good documentation on filter options as well.

What kind of documentation are you looking for? All filters are described in the readme:

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.

As of version 2.1 there is an additional filter mode:

  • prefixing a filter with extended: will work like the unprefixed filter but will additionally fetch single dates (those without end date) that lie in the past. This is helpful if you like to display banners only between certain dates and if the user didn't enter an end date. Using the extended filter, this will be interpreted as "display for ever".

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.

And yes: happy new year.

Thanks Nils,
I must have missed that, I've been searching the symphony 'concepts' for date filtering.
There is no documentation on that as far as i can see.
Most of the filters in the readme apply to symphony's default date field as well, i assume?

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