We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When i tried to insert an event in a cellphone with the 12 hour format, it doesn`t insert.
I replace this in calendarPlugin.m: [df setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
for this:
if ([self isHoras]){ [df setDateFormat:@"yyyy-MM-dd HH:mm:ss"]; } else { [df setDateFormat:@"yyyy-MM-dd hh:mm:ss"]; }
And add this function:
-(BOOL)isHoras{ NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; [formatter setLocale:[NSLocale currentLocale]]; [formatter setDateStyle:NSDateFormatterNoStyle]; [formatter setTimeStyle:NSDateFormatterShortStyle]; NSString *dateString = [formatter stringFromDate:[NSDate date]]; NSRange amRange = [dateString rangeOfString:[formatter AMSymbol]]; NSRange pmRange = [dateString rangeOfString:[formatter PMSymbol]]; BOOL is24h = (amRange.location == NSNotFound && pmRange.location == NSNotFound); [formatter release]; NSLog(@"%@\n",(is24h ? @"YES" : @"NO")); return is24h; }
finally add in calendarPlugin.h this:
Now it works ;)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
When i tried to insert an event in a cellphone with the 12 hour format, it doesn`t insert.
I replace this in calendarPlugin.m:
[df setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
for this:
And add this function:
-(BOOL)isHoras{
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
[formatter setLocale:[NSLocale currentLocale]];
[formatter setDateStyle:NSDateFormatterNoStyle];
[formatter setTimeStyle:NSDateFormatterShortStyle];
NSString *dateString = [formatter stringFromDate:[NSDate date]];
NSRange amRange = [dateString rangeOfString:[formatter AMSymbol]];
NSRange pmRange = [dateString rangeOfString:[formatter PMSymbol]];
BOOL is24h = (amRange.location == NSNotFound && pmRange.location == NSNotFound);
[formatter release];
NSLog(@"%@\n",(is24h ? @"YES" : @"NO"));
return is24h;
}
finally add in calendarPlugin.h this:
Now it works ;)
The text was updated successfully, but these errors were encountered: