Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-19439] Date properties of Ti.App.iOS.Searchable* and UserActivity should accept JS Date object

GitHub Issuen/a
TypeImprovement
PriorityNone
StatusOpen
ResolutionUnresolved
Affected Version/sRelease 5.0.0
Fix Version/sn/a
ComponentsiOS
Labelsn/a
ReporterFokke Zandbergen
AssigneeUnknown
Created2015-08-31T11:21:15.000+0000
Updated2018-02-28T19:55:35.000+0000

Description

The new [Titanium.App.iOS.SearchableItem](https://appcelerator.github.io/appc-docs/latest/#!/api/Titanium.App.iOS.SearchableItem), [Titanium.App.iOS.SearchableItemAttributeSet](https://appcelerator.github.io/appc-docs/latest/#!/api/Titanium.App.iOS.SearchableItemAttributeSet) and [Titanium.App.iOS.UserActivity](https://appcelerator.github.io/appc-docs/latest/#!/api/Titanium.App.iOS.UserActivity) API's all have one or more date-properties, all of which require: {quote} The date will be a string in the following format: "yyyy-MM-dd'T'HH:mm:ss.SSS'+0000'" For example, 2015-12-25T23:30:55.978+0000 {quote} Since Titanium developers work with the JS Date object all the time, we should support that (as well) just like we do in many other API's like [Titanium.App.iOS.LocalNotification](https://appcelerator.github.io/appc-docs/latest/#!/api/NotificationParams-property-date) and [Titanium.UI.Picker](https://appcelerator.github.io/appc-docs/latest/#!/api/Titanium.UI.Picker-property-maxDate)

Comments

  1. Fokke Zandbergen 2015-09-03

    Also, [~bhatfield] the current API reference for the value contains a typo. The ') between SSS and +0000 should not be there if you see the example value. And the given format is not usable in JavaScript, in particular the momentjs library that ships with Alloy. To get the correct format there you need:
       moment().format('YYYY-MM-DD[T]HH:mm:ss.SSSZZ');
       

JSON Source