Search

I’ve downloaded the lastest integration branch and it:

  1. No longer crashes when editing a previously saved date and time entry.
  2. No longer crashes when leaving an empty entry.

Works great, Nils!

If you’re using this field with German language settings, please see this bug report. The dateJS library which is used for this extension seems to be quite buggy and as it does more than we need it might be a good idea to remove the dependency on the whole library.

So this is known but yet unsolved bug.

is there an easy way to use this in the front end?

An Update

Some of you might have followed the development of Stage and Draggable which accompanied the Subsection Manager beta release. These two JavaScript plugins will be used as a base for the next major version of this extension.

If you have any feature request or if there are bugs in the current implementation of the Date and Time Field that have not been posted yet, please add them to the GitHub bug tracker.

Thanks,
Nils

Nils, this is a great extension! I’ve sent you two pull requests: the first commit is for the Italian language, the second is a patch that allows dates in the publish page to be shown in the current language. Let me know your thoughts!

Great! I’ll check it out soon.

Date and Time updated to version 1.4 on 27th of August 2010

  • Added Italian translation, improved date localisation. (Thanks, Simone!)

Nils,

I’m trying to filter a ds on this field, but I’m getting MySQL errors. I’m trying to filter by Regex using the following:

regex:^{$month:$this-month}-{$year:$this-year}

This throws the following error:

MySQL Error (1054): Unknown column 't63_1.value' in 'where clause' in query "SELECT  `e`.id, 
                    `e`.section_id, e.`author_id`, 
                    UNIX_TIMESTAMP(e.`creation_date`) AS `creation_date`, 
                    UNIX_TIMESTAMP(e.`creation_date_gmt`) AS `creation_date_gmt`

            FROM `sym_entries` AS `e`
             LEFT JOIN `sym_entries_data_61` AS `t61` ON (`e`.`id` = `t61`.entry_id) 
                LEFT JOIN
                    `sym_entries_data_63` AS t63_1
                    ON (e.id = t63_1.entry_id)
            LEFT OUTER JOIN `sym_entries_data_63` AS `dt` ON (`e`.`id` = `dt`.`entry_id`)       
            WHERE 1

            AND `e`.`section_id` = '15' 
             AND `t61`.relation_id IN ('455') 
                AND t63_1.value REGEXP '^2010-09'

            ORDER BY `dt`.`start` DESC
            LIMIT 0, 99999"

Which seems to be looking for a column ‘value’ which doesn’t exist…

I just had a look in the code and the problem is, that there is currently no real support for regex in this field. There will be an updated version of this extension based on Stage which will incorporate a lot of fixes so I add this to the list.

But, to help you out, here is a spontaneous guess what might fix your issue: Go to line 364 in /extensions/datetime/fields/field.datetime.php. Replace it with the following (untested) code:

if (self::isFilterRegex($data[0])) {
    $this->_key++;
    $pattern = str_replace('regexp:', '', $this->cleanValue($data[0]));
    $joins .= "
        LEFT JOIN
            `sym_entries_data_{$field_id}` AS t{$field_id}_{$this->_key}
            ON (e.id = t{$field_id}_{$this->_key}.entry_id)
    ";
    $where .= "
        AND t{$field_id}_{$this->_key}.start REGEXP '{$pattern} OR  t{$field_id}_{$this->_key}.end REGEXP '{$pattern}'
    ";  
    return true;
}

Maybe that works.

The only problem I see in this is that $field_id is not declared anywhere.

Yep, just tried it and it fails…

Added $field_id = $this->get('id'); just inside the if() statement, Also some other stuff needed fixing (missing backtick and extra spaces)…

I’m sending you a pull request with this code and my fixes.

Thanks very much Nils! :o)

For those using the current release (1.4) who are encountering the ‘Symphony Fatal Database Error’ when no start date is set, (but don’t want to move to the in-development 2.0 branch), you can apply the fix here:

https://github.com/nilshoerrmann/datetime/issues#issue/20

Thanks Nathan for posting this note - I haven’t found the time to check this issue.

Nils, I’ve sent you a couple pull requests with a norwegian translation and a fix for a bug I experienced on my end (sorry for the “duplicate” translation pull request).

Also, it seems one of the more recent fixes to check if we’re running in Administration mode doesn’t work on my local dev setup. The line:

if (Administration instanceof Symphony) {

always returns false here, and thus the required JS and CSS for this extension won’t get added. Haven’t had time to find a better check, so for now I’m just commenting this out locally. Don’t know if it’s just my version of PHP this fails in? Using PHP 5.3.3.

Thanks Frode!

Just a short note to everyone: there are a few issues related withthis extensions I’m aware of and I’m working on a general update. Due to other projects I haven’t found enough time to finish it but I didn’t forget about it. Just so you know.

Version 2 of this extension will use Symphony’s core localisation features and won’t rely on dateJS anymore. It will require the soon to be released Symphony 2.2.

Nils

Damnit. Discovered my norwegian translation wasn’t complete (used the Localization Manager to generate new language file, instead of copying one of the existing files…). I also hit upon a bug with saving localized relative dates, I think it’s the bug you mention in the readme. So I’ve fixed that as well.

I see you haven’t merged in my pull requests, which is good. But is it possible to delete them, and I’ll generate a new pull request with complete norwegian translation and both my bugfixes? Or is there a better way to send you the rest?

I think you can just close the current request and create a new one.

(sorry, double post)

My earlier requests have been closed and a combined and improved pull request has been sent! Hope I didn’t forget anything this time :)

Date and Time updated to version 1.5 on 11th of November 2010

  • Added Norwegian translation. (Thanks, Frode!)
  • Updated data source filtering. (Thanks, John!)

Yeah, never got round to doing that pull request ;o)

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