Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mergeTime(time, date) {
- console.log(time);
- console.log(date);
- const dateString = `${date.getDay()}/${date.getMonth()}/${date.getFullYear()}`;
- const timeString = `${time.getHours()}:${time.getMinutes()}:00`;
- const merged = new Date(`${dateString} ${timeString}`);
- console.log(merged);
- return this.timestamp(merged);
- }
- Tue Apr 24 2018 15:00:00 GMT-0400 (Eastern Daylight Time)
- Thu Apr 12 2018 02:42:07 GMT-0400 (Eastern Daylight Time)
- Tue Apr 03 2018 15:00:00 GMT-0400 (Eastern Daylight Time)
- timestamp(timeString) {
- return new Date(timeString).getTime();
- }
Add Comment
Please, Sign In to add comment