Welcome, Guest
Username Password: Remember me

SCDateCell bug
(1 viewing) (1) Guest

TOPIC: SCDateCell bug

SCDateCell bug 1 year, 7 months ago #1

I found a bug where if you have an SCDateCell and set this:

dateCell.datePicker.datePickerMode = UIDatePickerModeDate;


The date that is stored is not the date picked. If I pick the date of "Oct 16", the value stored in the bound object is "Oct 17".

I will email you a test project. In the test project, choose a date and then check out the "someDate" property of the "profile" object.
  • icyplains
  • OFFLINE
  • Expert Boarder
  • Posts: 133
  • Karma: 5

Re: SCDateCell bug 1 year, 7 months ago #2

Thanks again Tommy for sending us the test app, and again, issue couldn't be replicated

I added this method to your code:

 
- (void)tableViewModel:(SCTableViewModel *)tableViewModel
valueChangedForRowAtIndexPath:(NSIndexPath *)indexPath
{
NSLog(@"profile.someDate = %@", profile.someDate);
}
 


Then selected a date (today, Oct 18th), and here is the log:

testSCLog.png


Not sure exactly what's happening on your side, but I am guessing it's maybe a time zone problem? How are you checking the value of profile.someData?
  • tarekskr
  • OFFLINE
  • Administrator
  • Posts: 2402
  • Karma: 72

Re: SCDateCell bug 1 year, 7 months ago #3

I hit the break button on the app and then drill down in the debugger.

But, I added the logging code that you added.

I put in today's date (Oct 18th) and it is showing that it is Oct 19th in the log.

If it helps, I am in the Central time zone (-600, but -500 right now since we are in daylight savings time).
Capture.JPG
  • icyplains
  • OFFLINE
  • Expert Boarder
  • Posts: 133
  • Karma: 5

Re: SCDateCell bug 1 year, 7 months ago #4

It looks like your environment is sending the app GMT instead of your TimeZone offset.
  • Geoffrey
  • OFFLINE
  • Senior Boarder
  • Posts: 48
  • Karma: 3

Re: SCDateCell bug 1 year, 7 months ago #5

Thanks a lot for the observation Geoffrey.

Yes Tommy, why is your console displaying the date/time in GMT instead of Central time? I've just checked the test project you've sent me, and the date picker's "timeZone" property isn't being set, which means it should return the date/time in your local time zone (Central in your case). I am guessing that maybe your machine's/device's time zone isn't set up correctly?
  • tarekskr
  • OFFLINE
  • Administrator
  • Posts: 2402
  • Karma: 72

Re: SCDateCell bug 1 year, 7 months ago #6

They are set up properly.

I also added this line:

NSLog("Today's date is %@", [NSDate date]);

and got this (by picking Oct 18th again)


Have you tried setting your device or mac's timezone manually to Central DST and seeing what results you get?
Capture-20101018.JPG
  • icyplains
  • OFFLINE
  • Expert Boarder
  • Posts: 133
  • Karma: 5
Time to create page: 2.08 seconds