Skip to main content
Nintex Community Menu Bar
Solved

Date field formating rules

  • Jan 20, 2017 7:30 PM UTC
  • 4 replies
  • 146 views
  • Translate All

Forum|alt.badge.img+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

Best answer by jesse_mchargue

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!

View original

4 replies

Forum|alt.badge.img+16
  • Jan 20, 2017 10:07 PM UTC

try with true or false

Translate

Forum|alt.badge.img+2
  • Author
  • Jan 20, 2017 11:11 PM UTC

Sorry, it did not work.

Translate

jesse_mchargue
Forum|alt.badge.img+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!

Translate

Forum|alt.badge.img+2
  • Author
  • Jan 23, 2017 9:43 PM UTC

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.

Translate