Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

How can I change the time portion of a date time column to have 1 minute increments? When you create a coulmn by default it shows 5 minute increments, but I need to be able to use 1 minute increments. For example, I need to be able to pick 12:12, instead of 12:10 or 12:15.

share|improve this question
add comment

2 Answers

up vote 3 down vote accepted

It looks like you are out of luck at least with out of the box datetime field control. A little bit of reverse engineering revealed that they dropdown values are built into the control, not exposed.

You may have to write your own field control.

// Microsoft.SharePoint.WebControls.DateTimeControl
private string[] m_minutes = new string[]
{
    "00", 
    "05", 
    "10", 
    "15", 
    "20", 
    "25", 
    "30", 
    "35", 
    "40", 
    "45", 
    "50", 
    "55"
};
share|improve this answer
1  
Or add a content editor web part to your page and override the JavaScript values... :) –  Russell Dec 21 '11 at 20:21
    
yes, worth trying before writing a new control but not sure if that would conflict with viewstate or the code of the control... –  Ashish Patel Dec 21 '11 at 20:23
1  
The viewstate would contain the value of the DateTime field, which could contain any valid DateTime value. The Validated values (above) would not be in viewstate. –  Russell Dec 21 '11 at 20:28
    
Do you have a link with a sample of creating a field control? –  Bob Dec 21 '11 at 20:46
1  
About creating custom field control you can read here and in addition download some of custom filed controls for sharepoint from codeplex and investigate code (for example this one). Custom field type creation routine for 2010 sharepoint is the same as for 2007 –  Kai Dec 22 '11 at 6:14
show 1 more comment

you can use this from codeplex http://genericdatetime.codeplex.com/

share|improve this answer
    
Thanks for answering. While this may theoretically answer the question, we prefer inclusion of the essential parts of the answer here, and to provide the link for reference. See answer for general guidelines. –  SPDoctor Mar 27 '12 at 8:10
1  
While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. –  John Chapman Oct 16 '12 at 17:36
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.