Hello,
I have a DateTimeField with Data pattern date{DD.MM.YYYY} and Display pattern date{MMMM}, so it displays its default value "21.05.2011" as "May". Now I'm setting its value from the other field's initialize event:
if (this.rawValue) {
data.Subform_Footer2.DateTimeField1.rawValue = this.rawValue.match(/\d+\.\d+\.\d+/)[0];
}
Assuming this.rawValue contains text "21.04.2011", the DateTimeField displays "21.04.2011" in preview instead of "April" as specified in Display pattern.
Views
Replies
Total Likes
Hi,
To me it looks like you are passing a string to the date field, rather than a date.
Instead of trying to abstract the month manually in the script, why not pass the whole date through "21.04.2011" and leave the display pattern display the month.
Niall
Niall, I'm passing exactly "21.04.2011" to rawValue. match()[0] is the entire matched string which contains three dot-separated numbers.
Views
Replies
Total Likes
I just tried to set rawValue to '2011-04-21' and it displayed April. So the problem is Data pattern being ignored, not Display pattern.
Views
Replies
Total Likes
Ok, I've figured it. I have to set editValue, not rawValue.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies