-
Notifications
You must be signed in to change notification settings - Fork 801
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cellState.date Timezone issue #578
Comments
OK. func configureCalendar(_ calendar: JTAppleCalendarView) -> ConfigurationParameters {
// configure your custom calendar here configured to your time zone and locale
let myCalendar = Calendar(identifier: .gregorian)
myCalendar.timeZone = // myTimeZone
myCalendar.locale = // myLocale
let parameters = ConfigurationParameters(startDate:
startDate,
endDate: endDate,
calendar: myCalendar)
return parameters
} also, whenever you print dates to the console, never print the raw date. Always use a let formatter = DateFormatter()
formatter.dateFormat = "yyyy MM dd"
formatter.timeZone = myCalendar.timeZone
formatter.locale = myCalendar.locale
formatter.calendar = myCalendar
print(formatter.string(from: myDate) The reason for this is that the |
@patchthecode Thanks for explanation, I've corrected the code yesterday and everything is fine now 👍 |
Asweome. Closing this issue. |
v7.0.6
I noticed that CellState.date is giving date always in UTC but with timezone shifting, here is an example :
when: Region with timezone: Africa/Bamako @UTC
print(Date())
//2017-10-01 08:00:00 +0000print(cellState.date)
//2017-10-01 00:00:00 +0000when: Region with timezone: Asia/Baghdad @UTC+3
print(Date())
// 2017-10-01 08:00:00 +0000print(cellState.date)
// 2017-09-30 21:00:00 +0000 <-- Notice the time shifting hereit should give (2017-10-01 00:00:00 +0000) or (2017-09-30 21:00:00 +3)
Thanks for sharing your calendar ❤️
The text was updated successfully, but these errors were encountered: