This repository was archived by the owner on Mar 13, 2025. It is now read-only.
File tree 5 files changed +23
-17
lines changed
5 files changed +23
-17
lines changed Original file line number Diff line number Diff line change @@ -34,11 +34,7 @@ const Confirm = ({
34
34
const params = {
35
35
timezone : scheduleDetails . timezone ,
36
36
duration : scheduleDetails . duration ,
37
- availableTime : scheduleDetails . slots . map ( ( slot ) => ( {
38
- ...slot ,
39
- end : `${ slot . end } :00` ,
40
- start : `${ slot . start } :00` ,
41
- } ) ) ,
37
+ availableTime : scheduleDetails . slots ,
42
38
} ;
43
39
onShowingLoader ( true ) ;
44
40
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ import IconDelete from "../../../../../assets/images/icon-delete-slot.svg";
17
17
import IconPlus from "../../../../../assets/images/icon-plus.svg" ;
18
18
import "./styles.module.scss" ;
19
19
import Button from "components/Button" ;
20
+ import { formatAs2Digits } from "utils/format" ;
20
21
21
22
/**
22
23
* This component lets user to choose the availability of the interview candidate
@@ -47,7 +48,7 @@ const ManageAvailability = ({ scheduleDetails, onContinue }) => {
47
48
currentVal < 12
48
49
? `${ ! currentVal ? 12 : currentVal } :00`
49
50
: `${ Math . abs ( ( currentVal === 12 ? 0 : currentVal ) - 12 ) } :00` ,
50
- time24HourFormat : currentVal + 1 ,
51
+ time24HourFormat : ` ${ formatAs2Digits ( currentVal + 1 ) } :00` ,
51
52
suffix : currentVal < 12 ? "AM" : "PM" ,
52
53
} ,
53
54
] ,
Original file line number Diff line number Diff line change @@ -59,14 +59,7 @@ const InterviewPopup = ({
59
59
60
60
const prepareSlots = ( userSettings ) => ( {
61
61
timezone : userSettings . defaultTimezone ,
62
- slots :
63
- ( userSettings . defaultAvailableTime &&
64
- userSettings . defaultAvailableTime . map ( ( item ) => ( {
65
- days : item . days ,
66
- end : parseInt ( item . end . split ( ":" ) [ 0 ] ) ,
67
- start : parseInt ( item . start . split ( ":" ) [ 0 ] ) ,
68
- } ) ) ) ||
69
- [ ] ,
62
+ slots : userSettings . defaultAvailableTime || [ ]
70
63
} ) ;
71
64
72
65
/**
Original file line number Diff line number Diff line change @@ -2,9 +2,7 @@ import { axiosInstance as axios } from "./requestInterceptor";
2
2
import config from "../../config" ;
3
3
4
4
export const getUserSettings = ( userId ) => {
5
- return axios . get (
6
- `${ config . API . V5 } /taas/user-meeting-settings/${ userId } `
7
- ) ;
5
+ return axios . get ( `${ config . API . V5 } /taas/user-meeting-settings/${ userId } ` ) ;
8
6
} ;
9
7
10
8
export const deleteCalendar = ( userId , calendarId ) => {
Original file line number Diff line number Diff line change @@ -360,3 +360,21 @@ export const formatWorkTime = (time) => {
360
360
export const formatInviteTime = ( time ) => {
361
361
return moment ( time ) . format ( "MMM D, YY" ) ;
362
362
} ;
363
+
364
+ /**
365
+ * Format number as 2 digits:
366
+ * 7 -> 07
367
+ * 07 -> 07
368
+ *
369
+ * @param {number|string } value 1 or 2 digits number to format
370
+ * @returns {string } formatted 2-digits number
371
+ */
372
+ export const formatAs2Digits = ( number ) => {
373
+ const str = number . toString ( ) ;
374
+
375
+ if ( str . length < 2 ) {
376
+ return "0" + str ;
377
+ }
378
+
379
+ return str ;
380
+ } ;
You can’t perform that action at this time.
0 commit comments