Re: NSDateFormatter problem

2012-04-24 Thread Lorenzo Thurman

On Apr 20, 2012, at 9:32 AM, Keary Suska wrote:

 On Apr 20, 2012, at 6:08 AM, Lorenzo Thurman wrote:
 
 On Apr 19, 2012, at 10:18 PM, Keary Suska wrote:
 
 
 Perhaps this excerpt from the API doc is key: Do not use these constants 
 if you want an exact format. Why, might be academic, but if you require a 
 specific style, you may want to specify the style specifically.
 
 I have tried using strings to specify the styles, but no luck.
 
 It is next to impossible that specifying a fixed format will not render the 
 precisely requested results, except programmer error. We can't tell you what 
 you are doing wrong if you don't show us what you are doing.
 
 Is there a way to reset the Language and Text Preferences? Is there an 
 associated Preferences I can throw away?
 
 I think it is part of com.apple.systempreferences.plist in 
 ~/Library/Preferences. You can test that by dragging it to the desktop and 
 restarting.
 
 Keary Suska
 Esoteritech, Inc.
 Demystifying technology for your home or business
 



I agree. This should not happen, but here is my original code:
-(NSString*)formattedDate:(NSDate*)aDate{

NSDateFormatter * formatter = [[NSDateFormatter alloc] init];
[formatter setDateFormat:@mm-dd- hh:mm a];


NSString * dateString = [formatter stringFromDate:aDate];

return [self stringWithSentenceCapitalization:dateString];
}
and it produces the incorrect format.
It is called like this:

[weathervane formattedDate:[timer fireDate]];

[timer fireDate]
returns a date in this format:
2012-04-20 18:23:43 +

I've also rebuilt the revision of the source for the old build that I have and 
it produces the same flawed results. 
In any case, I'll edit the global prefs and see if it makes a difference. I 
really hope that I made an error somewhere. Thats a problem I can fix.


...Business! Mankind was my business. The common welfare was my business; 
charity, mercy, forbearance, and benevolence, were all my business. The 
dealings of my trade were but a drop of water in the comprehensive ocean of my 
business!

Marly's ghost - A Christmas Carol


Lorenzo Thurman
lore...@thethurmans.com




___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NSDateFormatter problem

2012-04-24 Thread Lorenzo Thurman

On Apr 20, 2012, at 9:32 AM, Keary Suska wrote:

 On Apr 20, 2012, at 6:08 AM, Lorenzo Thurman wrote:
 
 On Apr 19, 2012, at 10:18 PM, Keary Suska wrote:
 
 
 Perhaps this excerpt from the API doc is key: Do not use these constants 
 if you want an exact format. Why, might be academic, but if you require a 
 specific style, you may want to specify the style specifically.
 
 I have tried using strings to specify the styles, but no luck.
 
 It is next to impossible that specifying a fixed format will not render the 
 precisely requested results, except programmer error. We can't tell you what 
 you are doing wrong if you don't show us what you are doing.
 
 Is there a way to reset the Language and Text Preferences? Is there an 
 associated Preferences I can throw away?
 
 I think it is part of com.apple.systempreferences.plist in 
 ~/Library/Preferences. You can test that by dragging it to the desktop and 
 restarting.
 
 Keary Suska
 Esoteritech, Inc.
 Demystifying technology for your home or business
 



I agree. This should not happen, but here is my original code:
-(NSString*)formattedDate:(NSDate*)aDate{

NSDateFormatter * formatter = [[NSDateFormatter alloc] init];
[formatter setDateFormat:@mm-dd- hh:mm a];


NSString * dateString = [formatter stringFromDate:aDate];

return [self stringWithSentenceCapitalization:dateString];
}
and it produces the incorrect format.
It is called like this:

[weathervane formattedDate:[timer fireDate]];

[timer fireDate]
returns a date in this format:
2012-04-20 18:23:43 +

I've also rebuilt the revision of the source for the old build that I have and 
it produces the same flawed results. 
In any case, I'll edit the global prefs and see if it makes a difference. I 
really hope that I made an error somewhere. Thats a problem I can fix.


...Business! Mankind was my business. The common welfare was my business; 
charity, mercy, forbearance, and benevolence, were all my business. The 
dealings of my trade were but a drop of water in the comprehensive ocean of my 
business!

Marly's ghost - A Christmas Carol


Lorenzo Thurman
lore...@thethurmans.com




___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NSDateFormatter problem

2012-04-24 Thread Lorenzo Thurman

On Apr 20, 2012, at 11:30 AM, Charles Srstka wrote:

 On Apr 20, 2012, at 9:32 AM, Keary Suska wrote:
 
 Is there a way to reset the Language and Text Preferences? Is there an 
 associated Preferences I can throw away?
 
 I think it is part of com.apple.systempreferences.plist in 
 ~/Library/Preferences. You can test that by dragging it to the desktop and 
 restarting.
 
 The com.apple.systempreferences.plist file only determines the settings for 
 the System Preferences app itself. What you want is actually part of 
 .GlobalPreferences.plist, although that file also contains a lot of other 
 settings, so I wouldn’t nuke the whole plist file, but rather open it with 
 Xcode and edit it a bit more surgically.
 
 The pref keys you are interested in, I believe, would be AppleLocale, 
 AppleICUDateFormatStrings, and AppleICUTimeFormatStrings.
 
 Charles
 


[formatter setFormatterBehavior:NSDateFormatterBehavior10_4]

this fixed it. 

Thanks for the help

Yes Virginia, there is a Chaminade
--unknown

Lorenzo Thurman
lore...@thethurmans.com



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: NSDateFormatter problem

2012-04-24 Thread Keary Suska

On Apr 20, 2012, at 12:16 PM, Lorenzo Thurman wrote:

 I agree. This should not happen, but here is my original code:
 -(NSString*)formattedDate:(NSDate*)aDate{
   
   NSDateFormatter * formatter = [[NSDateFormatter alloc] init];
   [formatter setDateFormat:@mm-dd- hh:mm a];
   
   
   NSString * dateString = [formatter stringFromDate:aDate];
   
   return [self stringWithSentenceCapitalization:dateString];
 }
 and it produces the incorrect format.
 It is called like this:
 
 [weathervane formattedDate:[timer fireDate]];
 
 [timer fireDate]
 returns a date in this format:
 2012-04-20 18:23:43 +

This may be because the format is invalid, although I wouldn't have thought so. 
It should be: @MM-dd-yyy hh:mm a. Might be worth a try.

For giggles, what does -[formatter formatterBehavior] return? Does setting it 
explicitly to NSDateFormatterBehavior10_4 change anything?

 I've also rebuilt the revision of the source for the old build that I have 
 and it produces the same flawed results. 
 In any case, I'll edit the global prefs and see if it makes a difference. I 
 really hope that I made an error somewhere. Thats a problem I can fix.

Keary Suska
Esoteritech, Inc.
Demystifying technology for your home or business


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NSDateFormatter problem

2012-04-24 Thread Lorenzo Thurman

On Apr 20, 2012, at 11:30 AM, Charles Srstka wrote:

 On Apr 20, 2012, at 9:32 AM, Keary Suska wrote:
 
 Is there a way to reset the Language and Text Preferences? Is there an 
 associated Preferences I can throw away?
 
 I think it is part of com.apple.systempreferences.plist in 
 ~/Library/Preferences. You can test that by dragging it to the desktop and 
 restarting.
 
 The com.apple.systempreferences.plist file only determines the settings for 
 the System Preferences app itself. What you want is actually part of 
 .GlobalPreferences.plist, although that file also contains a lot of other 
 settings, so I wouldn’t nuke the whole plist file, but rather open it with 
 Xcode and edit it a bit more surgically.
 
 The pref keys you are interested in, I believe, would be AppleLocale, 
 AppleICUDateFormatStrings, and AppleICUTimeFormatStrings.
 
 Charles
 


[formatter setFormatterBehavior:NSDateFormatterBehavior
Yes Virginia, there is a Chaminade
--unknown

Lorenzo Thurman
lore...@thethurmans.com



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: NSDateFormatter problem

2012-04-24 Thread Lorenzo Thurman


My Break-Dancing days are over, but there's always the Funky Chicken -- The 
Full Monty

On Apr 20, 2012, at 3:47 PM, Keary Suska cocoa-...@esoteritech.com wrote:

 
 On Apr 20, 2012, at 12:16 PM, Lorenzo Thurman wrote:
 
 I agree. This should not happen, but here is my original code:
 -(NSString*)formattedDate:(NSDate*)aDate{

NSDateFormatter * formatter = [[NSDateFormatter alloc] init];
[formatter setDateFormat:@mm-dd- hh:mm a];


NSString * dateString = [formatter stringFromDate:aDate];

return [self stringWithSentenceCapitalization:dateString];
 }
 and it produces the incorrect format.
 It is called like this:
 
 [weathervane formattedDate:[timer fireDate]];
 
 [timer fireDate]
 returns a date in this format:
 2012-04-20 18:23:43 +
 
 This may be because the format is invalid, although I wouldn't have thought 
 so. It should be: @MM-dd-yyy hh:mm a. Might be worth a try.
 
 For giggles, what does -[formatter formatterBehavior] return? Does setting it 
 explicitly to NSDateFormatterBehavior10_4 change anything?
 
 I've also rebuilt the revision of the source for the old build that I have 
 and it produces the same flawed results. 
 In any case, I'll edit the global prefs and see if it makes a difference. I 
 really hope that I made an error somewhere. Thats a problem I can fix.
 
 Keary Suska
 Esoteritech, Inc.
 Demystifying technology for your home or business
 

I just got this one after I changed the behavior. And yes indeed, the format is 
wrong. Thanks again. 
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NSDateFormatter problem

2012-04-20 Thread Keary Suska
On Apr 20, 2012, at 6:08 AM, Lorenzo Thurman wrote:

 On Apr 19, 2012, at 10:18 PM, Keary Suska wrote:
 
 
 Perhaps this excerpt from the API doc is key: Do not use these constants if 
 you want an exact format. Why, might be academic, but if you require a 
 specific style, you may want to specify the style specifically.
 
 I have tried using strings to specify the styles, but no luck.

It is next to impossible that specifying a fixed format will not render the 
precisely requested results, except programmer error. We can't tell you what 
you are doing wrong if you don't show us what you are doing.

 Is there a way to reset the Language and Text Preferences? Is there an 
 associated Preferences I can throw away?

I think it is part of com.apple.systempreferences.plist in 
~/Library/Preferences. You can test that by dragging it to the desktop and 
restarting.

Keary Suska
Esoteritech, Inc.
Demystifying technology for your home or business


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NSDateFormatter problem

2012-04-20 Thread Charles Srstka
On Apr 20, 2012, at 9:32 AM, Keary Suska wrote:

 Is there a way to reset the Language and Text Preferences? Is there an 
 associated Preferences I can throw away?
 
 I think it is part of com.apple.systempreferences.plist in 
 ~/Library/Preferences. You can test that by dragging it to the desktop and 
 restarting.

The com.apple.systempreferences.plist file only determines the settings for the 
System Preferences app itself. What you want is actually part of 
.GlobalPreferences.plist, although that file also contains a lot of other 
settings, so I wouldn’t nuke the whole plist file, but rather open it with 
Xcode and edit it a bit more surgically.

The pref keys you are interested in, I believe, would be AppleLocale, 
AppleICUDateFormatStrings, and AppleICUTimeFormatStrings.

Charles

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com