GithubHelp home page GithubHelp logo

Current date issue about fscalendar HOT 13 CLOSED

wenchaod avatar wenchaod commented on July 18, 2024
Current date issue

from fscalendar.

Comments (13)

WenchaoD avatar WenchaoD commented on July 18, 2024

Thanks for your reporting. Fixed that in master repo. It seems working.

from fscalendar.

WenchaoD avatar WenchaoD commented on July 18, 2024

The currentMonth issue is fixed, but I don't quite understand the default month is 1 month earlier. Does that mean set the currentMonth to February in viewDidLoad?

from fscalendar.

tleafs avatar tleafs commented on July 18, 2024

The crash issue has been fixed.

But the default calendar still not showing the current month.

For example, run your demo app, it shows default month to be February, it
should show the current month, which is March with the current date
highlighted. Also if you tap on the setting icon of the demo app and go to
selected the date to March 18th, and it will go to Feb 18th. (this is bug).

Also in the demo:

_calendar.currentMonth = [NSDate fs_dateWithYear:2015 month:1 day:1];

Seem to work and show the Jan, but if you change it to

_calendar.currentMonth = [NSDate fs_dateWithYear:2015 month:3 day:18];

It shows the wrong month.

This library is the best open source calendar i seen so far. Great job and
thanks for the fast turning on fixing the issues. Let me know if you can
not reproduce the issue above or need further explanation.

Regards

-Tom

On Wed, Mar 18, 2015 at 9:58 PM, Wenchao Ding [email protected]
wrote:

The currentMonth issue is fixed, but I don't quite understand the default
month is 1 month earlier. Does that mean set the currentMonth to February
in viewDidLoad?


Reply to this email directly or view it on GitHub
#14 (comment)
.

from fscalendar.

WenchaoD avatar WenchaoD commented on July 18, 2024

For example, run your demo app, it shows default month to be February,
But when I start the simulator, it correctly shows the March
image
And this is 8.2 simulator, in English:
image

from fscalendar.

tleafs avatar tleafs commented on July 18, 2024

Strange, i see Feb when run the demo unchanged. see screen below:

ios simulator screen shot mar 18 2015 10 54 46 pm

from fscalendar.

WenchaoD avatar WenchaoD commented on July 18, 2024

Indeed, maybe because of the locale? What's your country?
And what's your device model?

from fscalendar.

tleafs avatar tleafs commented on July 18, 2024

I am using US region but also changed to others and same result. tested on iPhone 5 and iPhone 6 Simulators and same result. Installed on device and also have the same result which show Feb instead of March this month. Only thing i can think of it might be due to daylight saving time related? I recorded a video showing this strange behavior but can't attached to the github. let me know if you want me to send to you.

from fscalendar.

WenchaoD avatar WenchaoD commented on July 18, 2024

Of course, you can send me via my email address [email protected], better with more details, for example : the simulators system version, the Mac system version, xcode version .etc

from fscalendar.

tleafs avatar tleafs commented on July 18, 2024

Hi

Looks like the issue is due to time Zone.

Was able to reproduce it on device, Change time zone,
General/Date-time/Time Zone.

It could be daylight saving related.

On Wednesday, March 18, 2015, Wenchao Ding [email protected] wrote:

Of course, you can send me via my email address [email protected]
javascript:_e(%7B%7D,'cvml','[email protected]');, better with more
details, for example : the simulators system version, the Mac system
version, xcode version .etc


Reply to this email directly or view it on GitHub
#14 (comment)
.

from fscalendar.

WenchaoD avatar WenchaoD commented on July 18, 2024

That's it. I change the Time Zone to Los Angeles, the problem appears.

from fscalendar.

WenchaoD avatar WenchaoD commented on July 18, 2024

Problem solved. It's not about the daylight saving time. It's about the UTC time offset. In Los Angeles(UTC-08:00) , the [NSDate dateWithTimeIntervalSince1970:0] returns 1969/12/31 16:00, while in Beijing(UTC+08:00) it returns 1970/01/01 08:00. I shouldn't use that date for the minimumDate at all. Now I've tested it and it works well in both time zoon of L.A. and Beijing.

from fscalendar.

tleafs avatar tleafs commented on July 18, 2024

Nice! It is fixed.

from fscalendar.

emadhejazian avatar emadhejazian commented on July 18, 2024

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

from fscalendar.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.