Skip to main content

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

try with true or false


Sorry, it did not work.


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!


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