MomentMobile

Stable Version 1.1.2 (O11)
Also available for 10
Published on 03 July 2019 by 
Created on 26 July 2017
Documentation

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

Support Options
This component is not supported by OutSystems. You may use the discussion forums to leave suggestions or obtain best-effort support from the community, including from Matthias Preuter who created this component.
Dependencies
See all 1 dependencies