Solved

Date field formating rules

  • 20 January 2017
  • 4 replies
  • 53 views

Badge +2

I am using an Yes/No checkbox to change a DateTime field format to only display the Date format if checked. So far I have used just the Control (e.g. AllDayEvent), Control == '1', Control=='Yes', etc..) but the Date field in question does not change. Whats the trick?

 

197827_pastedImage_1.png

icon

Best answer by jesse_mchargue 23 January 2017, 21:00

View original

4 replies

Userlevel 6
Badge +16

try with true or false

Badge +2

Sorry, it did not work.

Userlevel 6
Badge +12

Ben Denison‌ - 

You cannot change the control format because it is tied to the field within the SharePoint list. You can either have it off (and not accept time) or have it on (and accept the time), but it has to be the same for all items.

Think about it like this; if you have a date column in your list and you have it set to be date only, all new records show the date, BUT it still captures the time (12:00:00 AM). If you change the column to be Date & Time, you see that all the older records have the 12:00AM timestamp added. 

I am sure you can add some JavaScripting to hide the time section of the control when AllDayEvent==true, but ultimately you still need to account for it. If you need a quick fix, you could add another date column and have one be date only and the other date & time and then using rules on your form, hide one that is not needed. You could then use different views on your list to show "All Day Events" vs non-All Day Events.

Sorry it is not a "fix", but hope it provides some other ideas!

Badge +2

Thanks Jesse. Adding additional fields with just the date format was going to be my fallback option. I was trying to the easy way out.

Reply