Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X
I have two date fields that I created for my test results: Execution Date and Execution Modified Date. When I kick them out to an html report, they do not format per the definition in the report wizard. Other date and date time fields do though. Is this a bug or am I doing something incorrectly? I can use JavaScript as a work around but I would prefer to not have to do that.
To elaborate a bit more...
After </head> and before <body>, I have: <%dateformat%> and <%datetimeformat%>
In the report wizard, I have specified:
Date Format: dd MMM yy
Date Time Format: dd-MMM-yy HH:mm
When I run the report, the normal Modified field spits out: 08-Jun-15 10:02
My custom test result field spits out: Jun 2, 2015 6:24:02 PM
HI Nolin,
I am not sure if internally the custom test result fields are stored as chars only. This would clarify why it comes out like it comes.
Depending on the critcality of your request, you may ask our Support how to solve.
- Volker
Volker,
I have it solved for now just by using JavaScript to parse it as a string and reformat it.
The field type is date. If it's stored as chars like you're suggesting, then that would explain the behavior. It sounds like that would be a bug since the reports should treat fields based on how they are defined in the admin client.
Thanks,
Nolin
a few more details...
I use moment.js and the below code to format the date.
function ConvertDate(originalDate) {
var newDate = moment(originalDate, "MMM D, YYYY h:mm:ss A");
newDate = newDate.format("DD MMM YY HHmm");
return newDate;
}