Skip to content
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

current date problem after change locale #144

Closed
devAlikhani opened this issue Nov 9, 2015 · 8 comments
Closed

current date problem after change locale #144

devAlikhani opened this issue Nov 9, 2015 · 8 comments

Comments

@devAlikhani
Copy link

Hi
I have a question about locale format of date, I want to convert this calendar to Persian calendar( I mean Solar Hijri calendar) then I use localIdentifier in viewDidLoad Function like this:

    calendar.locale = NSLocale(localeIdentifier: "fa_IR")

calendar is translated to Persian very good, but current date is not converted to Persian date, stay at Gregorian date,
how can i translate or update current date to Persian?

@devAlikhani devAlikhani changed the title current date after change locale current date problem after change locale Nov 9, 2015
@WenchaoD
Copy link
Owner

Hi @devAlikhani
Can you show me what Persian calendar looks like? October 2015 .e.g.

@WenchaoD
Copy link
Owner

Sorry for my poor knowledge about calendars, but what is today in Persian calendar? I got it printed into console, it gives me 1394-8-19
image
image

@devAlikhani
Copy link
Author

oh no you are fantastic, this date is correct, today is 1394/8/19 in Persian calendar

@WenchaoD
Copy link
Owner

OK. I'll figure out a way to fix this.

@devAlikhani
Copy link
Author

as a Persian Developer, I really thank you

@WenchaoD
Copy link
Owner

Fixed.

_calendar.identifier = NSCalendarIdentifierPersian;

@emadhejazian
Copy link

@devAlikhani I use this code line but my calendar is started from 1970,do you know why?

@emadhejazian
Copy link

I had this problem and I solved in this way:
fsCalendar.locale = NSLocale(localeIdentifier: "fa_IR") as Locale
fsCalendar.select(Date())
fsCalendar.identifier = NSCalendar.Identifier.persian.rawValue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants
@WenchaoD @emadhejazian @devAlikhani and others