Hi guys, here is another nice trick that took me a while to get.
Imagine you have a list with a Date field, only showing date value, not Time. If you create a Custom Display Form in Sharepoint Designer, you wiill see something incredible.
1. Edit your custom form in Sharepoint Designer
Imagine you have a list with a Date field, only showing date value, not Time. If you create a Custom Display Form in Sharepoint Designer, you wiill see something incredible.
- Date field shows Time value
- Date field shows less 1 hour, which might lead to show one less day in date value
Just like this:
Ok the goal is to format the date value, check how I did it.
1. Edit your custom form in Sharepoint Designer
Open your custom form in Sharepoint Designer and select the date value.
2. Add a format Formula
Click the Formula button and write the following Formula:
ddwrt:FormatDate(string(@Date), 1033, 1)
- Don't forget to use the string function!! Will give you an error in XPath bla bla bla...
- 1033 is the locale code, check other locale codes here List of Locale Codes
- 1 is the date format, the possible values are 1, 4, 5, 7,12, 13 or 15, each represent a different date format, pick the one that suites you better.
3. Save the custom form and its done
This was a big help, Thanks!
ReplyDeleteHi jobrocol, glad it helped :)
DeleteChecked your own blog and you also got some nice tips there, how can I register to follow you blog?
Thank you!
ReplyDelete