Skip to content

Commit

Permalink
Merge pull request #238 from TogetherCrew/fix/announcemments-reported…
Browse files Browse the repository at this point in the history
…-issues-22/1

update schadule announcement moment filter and time-picker
  • Loading branch information
mehdi-torabiv authored Jan 22, 2024
2 parents 5bf5f04 + dd98d37 commit 61a798c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ function TcDateTimePopover({
<StaticTimePicker
displayStaticWrapperAs="desktop"
value={selectedTime}
ampm={false}
onChange={handleTimeChange}
/>
</LocalizationProvider>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,13 @@ function TcScheduleAnnouncement({
const handleTimeChange = (time: Date | null) => {
if (time) {
setSelectedTime(time);
handleClose();

if (selectedDate) {
const fullDateTime = moment(selectedDate).set({
hour: time.getHours(),
minute: time.getMinutes(),
});
setDateTimeDisplay(fullDateTime.format('D MMMM YYYY @ h A'));
setDateTimeDisplay(fullDateTime.format('D MMMM YYYY @ hh:mm A'));
}
}
};
Expand All @@ -79,7 +78,7 @@ function TcScheduleAnnouncement({

setSelectedDate(date.toDate());
setSelectedTime(date.toDate());
setDateTimeDisplay(date.format('D MMMM YYYY @ h A'));
setDateTimeDisplay(date.format('D MMMM YYYY @ hh:mm A'));
}
}, [isEdit, preSelectedTime]);

Expand All @@ -101,7 +100,7 @@ function TcScheduleAnnouncement({
startIcon={<MdCalendarMonth />}
disableElevation={true}
className="border border-black bg-gray-100 shadow-md"
sx={{ color: 'black', height: '2.4rem' }}
sx={{ color: 'black', height: '2.4rem', paddingX: '1rem' }}
aria-describedby={id}
onClick={handleOpen}
/>
Expand Down

0 comments on commit 61a798c

Please sign in to comment.