ezdatetime as object name pattern

Author Message

Mads Ovesen

Monday 16 January 2006 2:18:40 pm

Between ez v. 3.4.4 and 3.4.7 there has been a change in the way ezpublish interprets the ezdatetime datatype when used as an object name pattern. In v. 3.4.4 is it shown as a timestamp and in v. 3.4.7 it is shown in the datetime format. Right now I have updated a site from 3.4.4 to 3.4.7, so some objects of a class (those prior to the upgrade), which uses ezdatetime as object name pattern, show a timestamp while others (those after the upgrade) show it in datetimeformat. This is confusing, because I want to sort the objects by 'name', that is by the timestamp. The new objects, when sorted by name, is sorted like fx:
friday_13_05_...
monday_07_03_...
saturday_05_09_...
thursday_03_01_...
i.e. not in any cronological order. How/Where can I change it back, so when the ezdatetime is used as a object name pattern, it uses the timestamp and not a datetime format of it??

- Thanks Mads

/m

Mads Ovesen

Thursday 19 January 2006 11:57:25 pm

Anyone?? Ez crew, why has this been changed??

/m

Ɓukasz Serwatka

Friday 20 January 2006 1:25:41 am

Hi Mads,

Take a look at eZDateTimeType::title() method in the kernel/classes/datatypes/ezdatetime/ezdatetimetype.php file. I can suppose that reason behind of this change was that timestamp is not human readable as object name. Object name like 'Saturday 14 January 2006 10:32:00 pm' says more about the date. However you can always do sorting on datetime attribute using sort_by or play with output format using datetime operator.

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Tobias Adam

Thursday 01 June 2006 6:45:53 am

Hi Mads,

I had the same problem and tried format the resulting object's name when using a ezdatetime datatype as object name pattern. I wanted something like YYYY-MM-DD, so that I could use the standard "sort by name"-function in the admin view to sort the items chronologically in the backend.

Because of Lukasz' tip I found out that eZ (I'm currently using version 3.6.1) uses the DateTimeFormat entry in the currently used locale ini-file (located in /share/locale) to create an object name based on an ezdatetime datatype.

In my case, I edited the file ger-DE.ini in /share/locale, where I changed the value DateTimeFormat=%l, %d.%F %Y %H:%i:%s in the DateTime settings group to DateTimeFormat=%Y-%m-%d %H:%i, which leads to a result like YYYY-MM-DD HH:MM.

[DateTime]
TimeFormat=%H:%i:%s
ShortTimeFormat=%H:%i
DateFormat=%l, %d.%F %Y
ShortDateFormat=%d.%m.%Y
#DateTimeFormat=%l, %d.%F %Y %H:%i:%s
DateTimeFormat=%Y-%m-%d %H:%i
ShortDateTimeFormat=%d.%m.%Y %H:%i
MondayFirst=yes

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 19 2025 01:11:41
Script start
Timing: Jan 19 2025 01:11:41
Module start 'layout'
Timing: Jan 19 2025 01:11:41
Module start 'content'
Timing: Jan 19 2025 01:11:42
Module end 'content'
Timing: Jan 19 2025 01:11:42
Script end

Main resources:

Total runtime0.8893 sec
Peak memory usage4,096.0000 KB
Database Queries62

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0066 589.1563152.6250
Module start 'layout' 0.00660.0029 741.781339.4453
Module start 'content' 0.00960.8784 781.2266584.0469
Module end 'content' 0.88790.0013 1,365.273412.1563
Script end 0.8893  1,377.4297 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00380.4325160.0002
Check MTime0.00190.2089160.0001
Mysql Total
Database connection0.00150.165210.0015
Mysqli_queries0.839594.3990620.0135
Looping result0.00060.0707600.0000
Template Total0.855796.220.4278
Template load0.00190.210220.0009
Template processing0.853896.008420.4269
Template load and register function0.00070.076110.0007
states
state_id_array0.00090.101710.0009
state_identifier_array0.00250.281620.0013
Override
Cache load0.00150.1731220.0001
Sytem overhead
Fetch class attribute can translate value0.00080.085430.0003
Fetch class attribute name0.00180.197450.0004
XML
Image XML parsing0.00090.100630.0003
class_abstraction
Instantiating content class attribute0.00000.001150.0000
General
dbfile0.00080.0863180.0000
String conversion0.00000.001140.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
4content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 13
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs