Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-17554] TiAPI: Support "full" date format

GitHub Issuen/a
TypeImprovement
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2015-06-01T23:18:29.000+0000
Affected Version/sRelease 3.3.0
Fix Version/sRelease 4.1.0
ComponentsTiAPI
LabelsTCSupport, android, ios
ReporterDaniel Ethier
AssigneeEric Merriman
Created2014-07-17T21:24:46.000+0000
Updated2017-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

FileDateSize
KrollContext.m2014-07-17T21:24:46.000+000042323

Comments

  1. Tim Poulsen 2014-12-01

    Community PR for this: https://github.com/appcelerator/titanium_mobile/pull/5655
  2. Ingo Muschenetz 2015-02-06

    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

  3. Chee Kiat Ng 2015-05-28

    PR Here: https://github.com/appcelerator/titanium_mobile/pull/6880
  4. Lee Morris 2017-03-16

    Closing ticket as fixed.

JSON Source