Incorrect dates showing in calendar

I have a custom form that enters dates onto a calendar. The end date always spans a day shorter than it is set to, even though all the data behind the entry shows the proper end date:

image

image

Here’s the custom form before submitting. It all seems to look as it should but when it appears on the calendar it only spans to the day before the end date.

I’ve never dug into the calendar component so I can’t say for certain how it’s supposed to work… but if you need to add 24 hrs to a date what you could do is use a math column

(Date)+1

Replace ‘Date’ with your end date and use that in your flow.

1 Like

Thank you, that worked instantly.

I’m new to the calendar so trying to get used to it. I still don’t get how the calendar can be pulling the dates directly from the table and then taking a day off the end date (timezone issue?) Also, your solution affects the ability to edit the time period by dragging the span bar. I guess it doesn’t work with computed columns. I had other issues with using templates as labels on the calendar so could be related to that. Really not sure!

Ok so maybe when you submit the custom form you could set the value of date+1 to a basic column…

Let me have a fiddle with it as to not send you around in circles :wink:

Ok so I think in your custom form you are using a date picker instead of ‘Date AND TIME’ picker right?.. the Date picker is going to choose the date @ 12:00AM vs. the date and time picker you could set it to 12:00 PM (or whatever time you’d like)

If you like your setup and just want to add 24 hrs to their choice… then in your custom form submit the math column instead of the end date.

You’re right, I’m using a date component because for this purpose there’s never going to be a need to choose a time and I thought it might save time to skip that step. Looks like it’s the reason behind the problem so I might swap it around and see how that goes. Thanks a lot for all your help with this.

1 Like

My pleasure glad I could help!.. just to reiterate if you like the current setup and want to avoid extra user button clicking/ mistakes… then submit the date+1 math column… if you set that math column to a basic column then you should be able to edit the date right from the calendar.

It would be the same process you currently have in your form… just swap the end date with math column.

1 Like

I have used the Date+1 method to fix the span that displays on the calendar but submitting it in the form would actually write that date in the recording sheet, which would mess with the payroll person at my workplace. The dates were always writing to the sheet properly, it was only the span being shown on the calendar that was a day short

1 Like

Ok so maybe you submit the end date + 1 and in the recording sheet you use New end date - 1 for payroll :man_shrugging:

I don’t want to give you bad advice so I’ll let other’s chime in :wink:

1 Like

Using your idea, I created a basic column just for the calendar span and added that as a separate part of the custom form. The original part that writes to the recording sheet stays as it was. Works perfectly. Thank you!

Edit - just have to hide that extra column in the sheet so payroll don’t use that one (although I doubt staff would be against the idea of getting paid an extra day every time they take a day off)

1 Like

:beers:

paid more

1 Like

Seems like you and @Eric_Penn have this pretty much sorted already…

But yes, the original issue you’re seeing Dan is because date picker is giving a datetime that’s your date at midnight… and in your first screen shot, June 3rd at 12:00am is the end of June 2nd.

By writing your date+1 math column to the displayed end date, you’re getting the view you originally expected… but then you do have to be sure you’re not reporting an extra day to payroll.

I would suggest using the math column to write your date plus 23hr & 59 min (or just 0.9999 day), rather than + 1 day. This will have your calendar appear the same, but when you view the end date as a date only column, it still shows the real end date… it’s just that by adding 23:59 to it, you’re visually seeing all of that day. Minor difference, but it could reduce potential confusions later with payroll.

6 Likes

Great tip! Thanks for going above and beyond and sharing this information

3 Likes

Good idea, I’ll do that. Thanks Matthew :+1:

1 Like