I make JTCalendar into custom view , all thing were working fine until I change timezone to EST, the calendar is showing 27 days for February but the actual number of days in 2018 is 28.
It happen when I start the app in default timezone and then changing the timezone to New York from settings, then when I open calendar, layout is wrong. After this when I tap into date 24 and result is date 23. only happen when I change timezone from IST to EST.
Related
I'm working on UIDatePicker. I have set panama time in my System for date is 18/11/2020 & time is evening 11:00 pm. When I get date, so it is giving me 19/11/2020 instead of 18/11/2020 & it's a wrong.
How can I fix this issue?
I got stuck that I don't know how to change Date Format in UIDatePicker? As default, current dateformat in UIDatePicker is December 23 2015. What I want is I want to change 23 Dec 2015.
Any solution will be appreciated.
The displayed date format of the UIDatePicker is depending on the locale settings of the UIDatePicker.
https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIDatePicker_Class/#//apple_ref/occ/instp/UIDatePicker/locale
To change it, you have to set an NSLocale, which prefers your format.
I am trying to select a date from DatePicker. It works properly often but when i select future date, the picker sets itself to current date(as per my code of maxdate). In this date shows current date in label but at backend object it is actually 1 day minus of current date. e.g After auto set of picker to current date, it displays in label 09-Apr-2015 but in my object(nsdate) which is want to Post to server api, it shows 2015-04-08 18:30:00 +0000. Thus my object send 8 apr to the server. Kindly reply if someone has faced this problem.
This is not a problem. The date picker is giving you correct time but only in the other time zone (Appears GMT+5:30)
When you are sending the date in your API, convert it to NSString using NSDateFormatter of the default time-zone or time-zone of your choice.
Some thing is wrong with your GMT settings.
try this code to fix:
[yourdataobject dateByAddingTimeInterval:[[NSTimeZone localTimeZone] secondsFromGMT]];
This will automatically fix your date in whatever zone your app is running in.
I am wondering if the code below will correctly display Eastern time correctly no matter what (day light savings or when it isn't day light savings). Right now my App isn't displaying data correctly because of day light savings. This code seems to work well now, but I don't want to find out in a few months that this time doesn't adjust correctly.
[NSTimeZone timeZoneWithName:#"US/Eastern"]
Yes,
For March 10 2015, it displays
US/Eastern (EDT) offset -14400 (Daylight)
For March 1 2015, it displays
US/Eastern (EST) offset -18000
I want to add event in device calendar on monthly which is working fine to me. But the problem is occurred in second condition. Suppose we add one event on 31st of each month and if 31 is not exist in that month then add on last day of that month such 30 April, 28 Feb.
Any suggestion to solve that condition???
Thanks