Do you have a need to display a date as a Julian Calendar date? While the date pickers cannot show this, you can display the date in Julian Calendar format in a label.
The Julian Calendar displays a date that is a combination of the year and the number of days since January 1st. Using the steps below you can display any selected date in the Julian calendar format.
1. Capture January 1st of the current year using the formula below. This will allow you to get the Julian Calendar date regardless of the year or whether it's a leap year or not.
Set(varFirstYear, DateAdd(Date(Year(Today()), Month(Today()), 1), -(Month(Today()) -1), Months))
2. Use this switch formula in your label's text property to display your date. The switch evaluates the number of characters remaining after subtracting the difference between Jan 1st and the selected Date from 3. If the remainder is 1, a 0 is added between the year and the number of days. If the remainder is 0, nothing is added.
Switch(
3 - Len(DateDiff(varFirstYear, DatePickerX.SelectedDate, Days)),
2, Concatenate(Right(Year(varFirstYear), 2) & "00" & DateDiff(varFirstYear, DatePickerX.SelectedDate, Days) + 1),
1, Concatenate(Right(Year(varFirstYear), 2) & "0" & DateDiff(varFirstYear, DatePickerX.SelectedDate, Days) +1),
0, Concatenate(Right(Year(varFirstYear), 2) & DateDiff(varFirstYear, DatePickerX.SelectedDate, Days) +1)
)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.