Skip to content

Commit da9b0eb

Browse files
author
shubhamBansal
committed
Timezone added back in server dates and some other logic changes
1 parent 54b625c commit da9b0eb

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

dashboard/src/utils/addDay.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
const addOneDay = (date) => {
2+
const newDate = new Date(date.setDate(date.getDate() + 1));
3+
const pad = (num) => (num < 10 ? "0" + num : num);
4+
const mNum = newDate.getMonth() + 1;
5+
const dNum = newDate.getDate();
6+
return `${newDate.getFullYear()}-${pad(mNum)}-${pad(dNum)}`;
7+
};
8+
9+
export default addOneDay;

0 commit comments

Comments
 (0)