refactor: export isPM to utils.js

This commit is contained in:
Jean Robertou
2021-08-06 21:00:07 +02:00
parent 06bae70384
commit 04fbf8ebf3
3 changed files with 11 additions and 10 deletions

8
pages/services/utils.js Normal file
View File

@@ -0,0 +1,8 @@
export const isPM = (time) => {
let hours = time.split(":")[0];
if (hours >= 12) {
return "PM";
} else {
return "AM";
}
};