Need calculation to combine a starting date with an ending date
Presently I have a standard date field for entering the starting date of an event (such as a seminar). I also have a date field to indicate its ending date.
In the same layout, I have a checkbox field named Date Type, enabling me to indicate how I want to display the event start date in a fourth field, named Display Date. My value list in Date Type lets me pick Day, Month, or year. If I pick Day, I get the day, month, and year; if I pick Month, I get just month and year; and if I pick year, I get just the year.
This is achieved successfully via the following calculation:
Let( m = If ( Filter ( Month ( Start_Date ) ; 567 ) ; MonthName ( Start_Date ) & " " ; Left ( MonthName ( Start_Date ) ; 3 ) & ". " ) ; Case( Date Type = "Day" ; Day ( Start_Date) & " " & m & Year ( Start_Date) ; Date Type = "Month" ; m & Year ( Start_Date ) ; Date Type = "Year" ; Year ( Start_Date) ) )
I want to enhance this calculation so that it will combine the start date and the end date (with a hyphen in between), in the same configurations -- e.g., starting day month year-ending day month year, starting month year-ending month year, starting year-ending year.
However, if the event starts and ends on the same day I want the result field to show only the start date in the selected configuration.