I'm going to have a go at answering your question. Please tell us if your question was different.
You can change the hour, minutes of all the Timestamp type attributes in a work item (bar those in Approvals tab -- that object can't be broken down) by defining an attribute customization for a Calculated Value of provider type Script-based Calculated Value. You do that by following the below link and writing a little snippet of Javascript.
Calculated Values
https://jazz.net/wiki/bin/view/Main/AttributeCustomization#Script_based_calculated_values
For example, you could write something like the below to remove the time portion whenever saving a work item:
dojo.provide("com.example.common.RemoveTimeCalc");
dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes");
dojo.require("dojo.date");
dojo.require("dojo.date.stamp");
(function() {
var WorkItemAttributes= com.ibm.team.workitem.api.common.WorkItemAttributes;
dojo.declare("com.example.common.RemoveTimeCalc", null, {
getValue: function(attributeId, workItem, configuration) {
var currentDate= dojo.date.stamp.fromISOString(workItem.getValue(WorkItemAttributes.DUE_DATE));
//console.log("The value of currentDate is: " + currentDate);
if (currentDate != null) {
currentDate.setHours(0);
currentDate.setMinutes(0);
currentDate.setMilliseconds(0);
var isoDate= dojo.date.stamp.toISOString(currentDate, {milliseconds:true, zulu:true});
return isoDate;
} else { return null; }
}
});
})();
You need to alter the WorkItemAttributes.DUE_DATE bit so that it matches the field you are applying it to. But the rest of the script, except for the name can be reused for each Timestamp field.
<Steps>
1. Go to the project area configuration in Eclipse under Workitems > Attribute Customization and add an entry under Calculated Value.
2. Paste the script as is here into the script section on the right.
3. Go to Workitems > Types and Attributes > select the correct work item type > scroll down to your attribute > Edit > add your new calculated value to the Due Date field
4. Repeat steps 1-3 changing the name of the script each time and altering the attribute name. For built-in attributes you can use WorkItemAttributes.XXXXXXX type name, as per https://jazz.net/wiki/bin/view/Main/AttributeCustomization#Accessing_built_in_attributes_of .
Comments
I don't quite understand what you want to achieve? Do you want a "day only" attribute?
I don't think so. I believe the date picker hard codes the default time as 12 noon. You can choose whether to make a timestamp a date or a date + time field initially in the editor presentation, but I think that is all. And the approval one is already there, so you can't customize it.
I get that impression from here:
https://jazz.net/jazz/web/projects/Rational%20Team%20Concert#action=com.ibm.team.workitem.viewWorkItem&id=239758
You might be able to define a default timestamp via Script-based default values. I haven't tested this with a timestamp type though. In this case you won't have to use the picker to choose a date. You can't specify a default timestamp value without writing your own Javascript, though. It isn't one of the options provided.
https://jazz.net/wiki/bin/view/Main/AttributeCustomization#Default_values