New features Please use http://kentico.uservoice.com as the primary place to submit your suggestions and allow others to vote for your ideas!
Version 5.x > New features > New attribute type: Date (no time) View modes: 
User avatar
Member
Member
danielrae - 1/18/2011 12:12:41 PM
   
New attribute type: Date (no time)
Hello,

I've found a need to store information as a date only, without the time. Would it be possible for this to be a new attribute type in Kentico, or perhaps make it easier to display date without time?

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 1/24/2011 7:41:44 AM
   
RE:New attribute type: Date (no time)
Hi,

I am not sure where and what you are using. But e.g. when using form control Date (as a new field e.g. in document type or bizform), you can uncheck the "Edit time" check box and only date part will be displayed.

Otherwise you need to use String.Format method to format the output according to your needs.

Best Regards,
Juraj Ondrus

User avatar
Member
Member
danielrae - 1/24/2011 9:31:59 AM
   
RE:New attribute type: Date (no time)
Hello,

I'm on 5.5 R2. In terms of attribute types in a custom document type, If I choose Date & Time, I don't see an "edit time" checkbox. Also, as an end user, I don't see this option either... where should I be looking for it?

User image

User avatar
Member
Member
danielrae - 1/24/2011 9:32:11 AM
   
RE:New attribute type: Date (no time)
User image

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 1/25/2011 3:05:57 PM
   
RE:New attribute type: Date (no time)
Hi,

In the screen shot, the field type is text - text box. Could you please select as attribute type "Date and time" and field type "Calendar"?

Best regards,
Juraj Ondrus

User avatar
Member
Member
sue.pearlman-johnscreekga - 7/25/2012 5:51:59 PM
   
RE:New attribute type: Date (no time)
Unselecting "Edit time" eliminates time in the content editor's form, but the document tree Order By expression is based on this date, and it shows "12:00:00 AM" on every document of this type in the tree.

Is there some way to eliminate the date display in the Content management document tree?

User avatar
Member
Member
sue.pearlman-johnscreekga - 7/25/2012 5:53:53 PM
   
RE:New attribute type: Date (no time)
Excuse me... I meant to say "eliminate the TIME display in the document tree."

User avatar
Kentico Support
Kentico Support
kentico_zdenekc - 8/1/2012 9:50:34 AM
   
RE:New attribute type: Date (no time)
Hello,

Do you mean that the time is displayed in the Form tab? Then it would be possible to modify the default Form or disable the Field "Display in the editing form" in Site manager -> Development-> Document types for the specified doctype.

Or do you mean any other place?
Thank you in advance for information.

Regards,
Zdenek

User avatar
Member
Member
sue.pearlman-johnscreekga - 8/2/2012 10:53:18 AM
   
RE:New attribute type: Date (no time)
Hi, Zdenek --

The form is fine -- time does NOT show because "Edit time" is not checked in the document type field definition.

However, when the documents created using the form are displayed in the document tree in date sequence, a default time of "12:00:00 AM" is shown, like this:

Board of Zoning Appeals
7/17/2012 12:00:00 AM
6/19/2012 12:00:00 AM
5/15/2012 12:00:00 AM
4/17/2012 12:00:00 AM
3/20/2012 12:00:00 AM
2/21/2012 12:00:00 AM

Is there any way to just show the date, not the time?

Thanks --
Sue

User avatar
Member
Member
sue.pearlman-johnscreekga - 8/2/2012 10:56:33 AM
   
RE:New attribute type: Date (no time)
User image

This is what it looks like on the screen.

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 8/3/2012 1:23:41 AM
   
RE:New attribute type: Date (no time)
Hi,

this is the default value which is saved in the database for given data type. What you want to have is not really the date/time data type. I would recommend to create a custom form control - which will contain the date/time control to select the date but it will also strip the time and save this data as a text and not date/time type in the database.

Best regards,
Juraj Ondrus