Forums / General / ezdatetime as object name pattern

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

eZ debug

Timing: Jan 18 2025 22:29:13
Script start
Timing: Jan 18 2025 22:29:13
Module start 'content'
Timing: Jan 18 2025 22:29:13
Module end 'content'
Timing: Jan 18 2025 22:29:13
Script end

Main resources:

Total runtime0.2963 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0178 588.8438180.8359
Module start 'content' 0.01780.0129 769.679797.9766
Module end 'content' 0.03070.2655 867.6563527.0469
Script end 0.2962  1,394.7031 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00431.4643200.0002
Check MTime0.00160.5432200.0001
Mysql Total
Database connection0.00923.092310.0092
Mysqli_queries0.216272.95751410.0015
Looping result0.00220.73401390.0000
Template Total0.264989.410.2649
Template load0.00150.516010.0015
Template processing0.263488.897410.2634
Override
Cache load0.00070.220110.0007
Sytem overhead
Fetch class attribute can translate value0.00140.463410.0014
XML
Image XML parsing0.00040.149610.0004
General
dbfile0.00311.0596200.0002
String conversion0.00000.001930.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs