This widget allows you to determine and display the "ago" time.
- Calculate the "ago" time
- Localization support
Download this repository and consult the Alloy Documentation on how to install it, or simply use the gitTio CLI:
$ gittio install it.toriphes.timeago
-
In alloy add the widget to your View
<Alloy> <Window class="container"> <Widget id="ta" src="it.toriphes.timeago" date="2012-10-08" /> </Window> </Alloy>
-
or in the controller
var ta = Alloy.createWidget("it.toriphes.timeago"); ta.inWords("2012-10-08");
Localization file are in $project_root/app/widgets/it.toriphes.timeago/i18n
If a localization is not present within the widget you can write it and send a pull request or implement the translated strings in your localization file
All the options are passed to the label object. Special option
Parameter | Type | Default |
---|---|---|
date | string |object |array |Date |Moment |
undefined |
Function | Parameters | Usage |
---|---|---|
inWords | string |object |array |Date |Moment |
Returns the timeago string |