Skip to content

Commit

Permalink
Merge branch 'master' into rs-app-2292
Browse files Browse the repository at this point in the history
  • Loading branch information
Alphajax authored Nov 6, 2023
2 parents 0a4be7b + d3dc56a commit c656696
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,9 @@ export function getInitialValues(modalData: Partial<CourseEvent>) {
type: EVENT_TYPES.find(event => event.id === modalData.event?.type)?.id ?? null,
descriptionUrl: modalData.event?.descriptionUrl ? modalData.event.descriptionUrl : '',
description: modalData.event?.description ? modalData.event.description : '',
dateTime: modalData.dateTime ? dayjs.utc(modalData.dateTime) : null,
endTime: modalData.endTime ? dayjs.utc(modalData.endTime) : null,
//need to refactor
dateTime: dayjs.utc(modalData.dateTime ?? undefined),
endTime: dayjs.utc(modalData.endTime ?? undefined),
organizerId: modalData.organizer ? modalData.organizer.id : undefined,
special: modalData.special ? modalData.special.split(',') : [],
timeZone,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,7 @@ export function CourseTaskModal(props: Props) {
label="Start Date - End Date"
rules={[{ required: true, type: 'array', message: 'Please enter start and end date' }]}
>
<DatePicker.RangePicker
showTime={{ format: 'HH:mm', defaultValue: [dayjs().hour(0).minute(0), dayjs().hour(23).minute(59)] }}
/>
<DatePicker.RangePicker showTime={{ format: 'HH:mm' }} />
</Form.Item>
</Col>
<Col span={6}>
Expand Down Expand Up @@ -216,7 +214,7 @@ function createRecord(values: any): CreateCourseTaskDto {
const data = {
studentStartDate: startDate.utc().format(),
studentEndDate: endDate.utc().format(),
crossCheckEndDate: crossCheckEndDate ? crossCheckEndDate.utc().hour(23).minute(59).format() : undefined,
crossCheckEndDate: crossCheckEndDate ? crossCheckEndDate.utc().hour(23).minute(59).second(59).format() : undefined,
taskId: values.taskId,
taskOwnerId: values.taskOwner?.id,
checker: values.checker,
Expand Down Expand Up @@ -244,7 +242,7 @@ function getInitialValues(modalData: Partial<CourseTaskDetails>) {
modalData.studentStartDate ? dayjs.utc(modalData.studentStartDate) : null,
modalData.studentEndDate ? dayjs.utc(modalData.studentEndDate) : null,
]
: null,
: [dayjs().utc().hour(0).minute(0).second(0), dayjs().utc().hour(23).minute(59).second(58)],
checker: modalData.checker || CreateCourseTaskDtoCheckerEnum.AutoTest,
};
return data;
Expand Down

0 comments on commit c656696

Please sign in to comment.