|
|
|
|
|
|
|
|
{ |
|
|
{ |
|
|
[dateFormatter setDateFormat:@"HH:mm"]; |
|
|
[dateFormatter setDateFormat:@"HH:mm"]; |
|
|
}else{ |
|
|
}else{ |
|
|
[dateFormatter setDateFormat:@"hh:mm a"]; |
|
|
|
|
|
|
|
|
[dateFormatter setDateFormat:@"h:mm a"]; |
|
|
} |
|
|
} |
|
|
dateLabel.text = [dateFormatter stringFromDate:date]; |
|
|
dateLabel.text = [dateFormatter stringFromDate:date]; |
|
|
[dateLabel sizeToFit]; |
|
|
[dateLabel sizeToFit]; |
|
|
|
|
|
|
|
|
NSRange pmRange = [dateString rangeOfString:[formatter PMSymbol]]; |
|
|
NSRange pmRange = [dateString rangeOfString:[formatter PMSymbol]]; |
|
|
is24h = (amRange.location == NSNotFound && pmRange.location == NSNotFound); |
|
|
is24h = (amRange.location == NSNotFound && pmRange.location == NSNotFound); |
|
|
[formatter release]; |
|
|
[formatter release]; |
|
|
} |
|
|
|
|
|
|
|
|
} |