momentmobile
Mobile icon

MomentJS Library for Reactive and Mobile

Stable version 2.29.2 (Compatible with OutSystems 11)
Other versions available for 10
Published on 17 Jan by 
5.0
 (3 ratings)
momentmobile

MomentJS Library for Reactive and Mobile

Documentation
2.29.2

This library is based on moment.js; and now have the following client actions with localization in many languages.


momentAdd

input: referenceDateTime, Unit, Value

output: DateTime

Returns the original moment by adding Value by Unit.
This is a pretty robust function for adding time to an existing moment. To add time, pass the key of what time you want to add, and the amount you want to add. For example MonmentAdd( CurrDateTime() 'year', 10) returns today + 10 years.



momentCalendar 

input: referenceDate, Locale 

output: Text

Will format a date with different strings depending on how close to referenceDate (today by default) the date is.

Last weekLast Monday at 2:30 AM
The day beforeYesterday at 2:30 AM
The same dayToday at 2:30 AM
The next dayTomorrow at 2:30 AM
The next weekSunday at 2:30 AM
Everything else7/10/2011


momentDiff

input: referenceDateTime1, referenceDateTime1, Unit, WithFractions, Value

output: Integer

Returns the Duration in Unit (year, month, week, day) between referenceDateTime1 and referenceDateTime2


momentEndOf

input: referenceDateTime, Unit

output: DateTime

Returns the EndOf a given period (unit, (year, quarter, month, week, day).


momentFormat

input: referenceDateTime, Format, Locale

output: Text

Returns the referenceDateTime in given Format and Locale, for example

MomentFormat(#2019-06-04 01:42#, "LLLL", "de") returns 'Freitag, 24. Juni 2016 01:42'


Go to the Moment JS website for the full description of the format / parsing a string with localization.


momentStartOf

input: referenceDateTime, Unit

output: DateTime  

Returns the StartOf a given period (unit, (year, quarter, month, week, day).


momentSubstract

input: referenceDateTime, Unit, Value

output: DateTime

Returns the original moment by substracting Value by Unit.
This is a pretty robust function for adding time to an existing moment. To add time, pass the key of what time you want to add, and the amount you want to add. For example MonmentAdd( CurrDateTime() 'year', 10) returns today - 10 years.


momentWeekDay_Date

input: referenceDateTime, daynumber, locale

output: Value

This method can be used to get the date for  the daynumber week of referenceDateTime


momentWeekDay_Number

input: referenceDateTime, locale

output: Value

This method can be used to get the day of the week, with Sunday as 0 and Saturday as 6.


For full documentation of this javascript library go to the project website https://momentjs.com


Silk UI Framework Simulation Device
Resize the window to preview the page in target devices.
Open the settings to change the simulation device options.