kinoklub-api
Advanced tools
Comparing version 0.0.1-next.6 to 0.0.1-next.7
@@ -19,14 +19,19 @@ const TIMEZONE = '.000+01:00'; | ||
const today = new Date(); | ||
const day = today.getDate(); | ||
const month = today.getMonth(); | ||
const year = today.getFullYear(); | ||
const addLeadingZero = (num) => { | ||
return num < 10 ? `0${num}` : `${num}`; | ||
}; | ||
if (weekDay === 'Dnes' || weekDay === 'Today') { | ||
dateTime = `${today.getFullYear()}-${today.getMonth() + 1}-${today.getDate()}T${hour}:00${TIMEZONE}`; | ||
dateTime = `${year}-${addLeadingZero(month + 1)}-${addLeadingZero(day)}T${hour}:00${TIMEZONE}`; | ||
} | ||
else if (weekDay === 'Zítra' || weekDay === 'Tomorrow') { | ||
const today = new Date(); | ||
dateTime = `${today.getFullYear()}-${today.getMonth() + 1}-${today.getDate() + 1}T${hour}:00${TIMEZONE}`; | ||
dateTime = `${year}-${addLeadingZero(month + 1)}-${addLeadingZero(day + 1)}T${hour}:00${TIMEZONE}`; | ||
} | ||
else { | ||
const [day, month] = dayRest.split('/'); | ||
dateTime = `${today.getFullYear()}-${month}-${day}T${hour}:00${TIMEZONE}`; | ||
dateTime = `${year}-${addLeadingZero(+month)}-${addLeadingZero(+day)}T${hour}:00${TIMEZONE}`; | ||
} | ||
return new Date(dateTime).toISOString(); | ||
}; |
{ | ||
"name": "kinoklub-api", | ||
"version": "0.0.1-next.6", | ||
"version": "0.0.1-next.7", | ||
"description": "Support library for KinoKlub", | ||
@@ -5,0 +5,0 @@ "main": "./index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
19341
403