You are viewing limited content. For full access, please sign in.

Question

Question

Changing Date Field changed value for all docs

asked on March 9, 2016

We had a client that was using the "short date" for a field but wanted the month to always be 2 digits. She changed the field to custom and added a 0 in front but that changed the date for all the fields to that days date 03/07/16. 

Is this expected behavior? They were not happy that changing the format of the field changed all of their manually entered dates for the whole repository. Luckily switching it back resolved the situation. 

 

Is there syntax they could use so that the format is MM/DD/YY? 



0 0

Answer

SELECTED ANSWER
replied on March 9, 2016

The format string should not change the underlying data in the field, but it does change how it is to be displayed. The format strings should be specified using MS .NET style format strings (Reference article here). Sounds like you should be entering something like "MM/dd/yy" or something. Note that capital M is for months, and lowercase m is for minutes.

2 0

Replies

replied on March 9, 2016

So is it a bug that the date changed for all docs with that field?

replied on March 9, 2016

So is it a bug that all documents with that field had the date change? 

0 0
replied on March 9, 2016

No, that's how formatting a field works. It's for all values in that field. It's a display option, it does not actually alter the value.

0 0
replied on March 9, 2016

Ok so in this case it altered the value rather than the formatting which should not happen. They had manually entered dates which were all changed to 03/07/2016 when trying to change the custom formatting. 

0 0
replied on March 9, 2016

It will alter what the displayed value is for all documents, but not the value stored to the database.

Since you said "switching it back resolved the situation", there does not appear to be any bug. If the database values had actually been changed, you would have been unable to get the data back.

As indicated by Scott Wilson's response, formatting is not handled by putting in example numbers: if you put in a number into the format, that number will always be displayed.

Note that If you are viewing a field with custom date formatting, clicking into the field will always show you the date in the default format, e.g., 03/10/2016.

 

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.