I`d like to change the date format of the embaded generic properties (uodateDate, createDate e.t.c). I can use umbraco.library:FormatDateTime to format my oun property, but I don`t know how to reach the propeties mentioned above. Can anybody help me?
Hi Aleksander, if I understand you correctly it's a matter of accessing node properties. Any content node has and updateDate and createDate, and they can be accessed as a normal property by e.g.
Thank a lot for the quick answers, but actualy my questions was how to replace the existing date format with my own. The examples above, as I understand are how to pick the properties of the page. But I want (if it`s possible) to replace the existing date format in the admin panel with another one.
Do you want to be able to select a date yourself for a specific node? If you for instance have some news nodes where you want to add a date you could specify a date field on your document type and use that instead of the @createDate and @updateDate.
When you create some document type, there are some embedded properties, that appears on the 'Properties' tab by default. For example, the third property is named 'Created' and actualy shows the date of creation of the document type. My question is: can I just set the format of this date, without changing the default culture of my PC or the language settings in Umbraco?
Ok - But I think that Jesper has already answered that then? You don't need to format the date like he has done. It is entirely up to you how you want it to look like. Instead of "dd.MM.yyyy" you could have "MM/dd/yyyy" for instance. It's all up to you.
maybe I can`t explain or, just can`t understand, but I want to change the display format of the dates in admin panel, not to pick them and place in other part of my application.
Ok - now I get it. You're trying to alter the way dates are displayed in the Umbraco backend.
As far as I know there's no setting anywhere that controls the display of dates (please anyone; correct me if I'm wrong), so if it's really important to you, you'll probably have to download the source code for Umbraco and change the code to suit your needs. But that will make your changes vulnerable to future upgrades.
You could also try adding this as an Issue on codeplex, and suggest the core team changes the date display code to use a datetime.ToString() that outputs a localized version of the date. That would render the date in a way that corresponds to the regional settings of the server Umbraco is running on.
Generic property date format
Hello!
I`d like to change the date format of the embaded generic properties (uodateDate, createDate e.t.c). I can use umbraco.library:FormatDateTime to format my oun property, but I don`t know how to reach the propeties mentioned above. Can anybody help me?
Thanks a lot in advance!
You should be able to use umbraco.library:FormatDateTime on updateDate and createDate like this:
For createDate just substitute @updateDate with @createDate in the above statement.
Regards
.Hauge
A minor error - use this instead:
.Hauge
Hi Aleksander, if I understand you correctly it's a matter of accessing node properties. Any content node has and updateDate and createDate, and they can be accessed as a normal property by e.g.
But maybe I misunderstood?
>Tommy
aah - Jesper already answered ;-)
by the way - you can see all available node properties here : http://blackpoint.dk/umbraco-workbench.aspx?Snippet=/umbraco-workbench/xslt/accessing-node-information.aspx
>Tommy
Hi!
Thank a lot for the quick answers, but actualy my questions was how to replace the existing date format with
my own. The examples above, as I understand are how to pick the properties of the page. But I want (if it`s possible) to replace the existing date format in the admin panel with another one.
Excuse me for the misunderstanding!
Thanks,
Aleksander.
Hi Aleksander
Do you want to be able to select a date yourself for a specific node? If you for instance have some news nodes where you want to add a date you could specify a date field on your document type and use that instead of the @createDate and @updateDate.
Is this what you are looking for?
Hi Tommy
Great post! Maybe you should add it to the wiki-section also? I think it would be a very good contribution.
/Jan
Hi Jan
When you create some document type, there are some embedded properties, that appears on the 'Properties' tab by default. For example, the third property is named 'Created' and actualy shows the date of creation of the document type. My question is: can I just set the format of this date, without changing the default culture of my PC or the language settings in Umbraco?
Thanks,
Aleksander
Hi Aleksander
Ok - But I think that Jesper has already answered that then? You don't need to format the date like he has done. It is entirely up to you how you want it to look like. Instead of "dd.MM.yyyy" you could have "MM/dd/yyyy" for instance. It's all up to you.
Hope this helps.
/Jan
Hi,
maybe I can`t explain or, just can`t understand, but I want to change the display format of the dates in admin panel, not to pick them and place in other part of my application.
Thanks,
Aleksander
Ok - now I get it. You're trying to alter the way dates are displayed in the Umbraco backend.
As far as I know there's no setting anywhere that controls the display of dates (please anyone; correct me if I'm wrong), so if it's really important to you, you'll probably have to download the source code for Umbraco and change the code to suit your needs. But that will make your changes vulnerable to future upgrades.
You could also try adding this as an Issue on codeplex, and suggest the core team changes the date display code to use a datetime.ToString() that outputs a localized version of the date. That would render the date in a way that corresponds to the regional settings of the server Umbraco is running on.
Regards
.Hauge
is working on a reply...