feat: display year for bookings in different years (#20647)
Conditionally displays the year in the date format for upcoming bookings on the /bookings page when the booking's year differs from the current year. Fixes CAL-5455 Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: eunjae@cal.com <eunjae@cal.com>
This commit is contained in:
co-authored by
eunjae@cal.com
parent
10fa080b7f
commit
07d8a39829
@@ -387,10 +387,14 @@ function BookingListItem(booking: BookingItemProps) {
|
||||
);
|
||||
};
|
||||
|
||||
const bookingYear = dayjs(booking.startTime).year();
|
||||
const currentYear = dayjs().year();
|
||||
const isDifferentYear = bookingYear !== currentYear;
|
||||
|
||||
const startTime = dayjs(booking.startTime)
|
||||
.tz(userTimeZone)
|
||||
.locale(language)
|
||||
.format(isUpcoming ? "ddd, D MMM" : "D MMMM YYYY");
|
||||
.format(isUpcoming ? (isDifferentYear ? "ddd, D MMM YYYY" : "ddd, D MMM") : "D MMMM YYYY");
|
||||
const [isOpenRescheduleDialog, setIsOpenRescheduleDialog] = useState(false);
|
||||
const [isOpenReassignDialog, setIsOpenReassignDialog] = useState(false);
|
||||
const [isOpenSetLocationDialog, setIsOpenLocationDialog] = useState(false);
|
||||
|
||||
Reference in New Issue
Block a user