[TIMOB-17554] TiAPI: Support "full" date format
GitHub Issue | n/a |
---|---|
Type | Improvement |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2015-06-01T23:18:29.000+0000 |
Affected Version/s | Release 3.3.0 |
Fix Version/s | Release 4.1.0 |
Components | TiAPI |
Labels | TCSupport, android, ios |
Reporter | Daniel Ethier |
Assignee | Eric Merriman |
Created | 2014-07-17T21:24:46.000+0000 |
Updated | 2017-03-16T22:51:39.000+0000 |
Description
In KrollContext.m please add the following code to the function StringFormatDateCallback (at about line 434 in 3.3 SDK)
else if ([s isEqualToString:@"full"])
{
style = NSDateFormatterFullStyle;
}
This will add support for the full date format, which is the same as the long date format, but with the day of the week. You can add the same code to the following function to support the full format for time as well.
A very simple change. Thanks.
Attachments
File | Date | Size |
---|---|---|
KrollContext.m | 2014-07-17T21:24:46.000+0000 | 42323 |
Community PR for this: https://github.com/appcelerator/titanium_mobile/pull/5655
In order to support this we need a few additions:
Documentation
Since it is a global API, support on other platforms where it is already implemented:
Android: https://github.com/appcelerator/titanium_mobile/blob/master/android/titanium/src/java/ti/modules/titanium/TitaniumModule.java#L275 (DateFormat.FULL is available)
BlackBerry: https://github.com/appcelerator/titanium_mobile_blackberry/blob/master/src/tibb/src/NativeStringInterface.cpp#L30
MobileWeb: Not implemented, so okay: https://github.com/appcelerator/titanium_mobile/blob/master/mobileweb/titanium/Ti/Locale.js#L28
PR Here: https://github.com/appcelerator/titanium_mobile/pull/6880
Closing ticket as fixed.