- MomentJS - Examples
- MomentJS - Plugins
- MomentJS - Utilities
- MomentJS - Durations
- MomentJS - Customization
- MomentJS - Internationalization
- MomentJS - Date Queries
- Formatting Date And Time
- Manipulate Date And Time
- MomentJS - Getter/Setter
- MomentJS - Date Validation
- MomentJS - Parsing Date And Time
- MomentJS - Introduction
- MomentJS - Environment Setup
- MomentJS - Overview
- MomentJS - Home
MomentJS Useful Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
MomentJS - Getter/Setter
MomentJS has many methods to get/set the date inputs. Get will allow us to read the required input unit and set will allow to modify the input unit. This chapter discusses in detail the get/set methods to be used on the moment.
The following table shows the get/set methods available −
Method | Syntax |
---|---|
moment().milpsecond(Number) moment().milpsecond(); moment().milpseconds(Number); moment().milpseconds(); |
|
moment().second(Number); moment().second(); moment().seconds(Number); moment().seconds(); |
|
moment().minute(Number); moment().minute(); moment().minutes(Number); moment().minutes(); |
|
moment().date(Number); moment().date(); moment().dates(Number); moment().dates(); |
|
moment().day(Number|String); moment().day(); moment().days(Number|String); moment().days(); |
|
moment().date(Number); moment().date(); moment().dates(Number); moment().dates(); |
|
moment().dayOfYear(Number); moment().dayOfYear(); |
|
moment().week(Number); moment().week(); moment().weeks(Number); moment().weeks(); |
|
moment().isoWeek(Number); moment().isoWeek(); moment().isoWeeks(Number); moment().isoWeeks(); |
|
moment().month(Number|String); moment().month(); |
|
moment().quarter(); moment().quarter(Number); moment().quarters(); moment().quarters(Number); |
|
moment().year(Number); moment().year(); |
|
Week year |
moment().weekYear(Number); moment().weekYear(); |
Weeks in year |
moment().weeksInYear(); |
moment().get( year ); moment().get( month ); moment().get( date ); moment().get( hour ); moment().get( minute ); moment().get( second ); moment().get( milpsecond ); |
|
moment().set(String, Int); moment().set(Object(String, Int)); |
|
moment.max(Moment[,Moment...]); moment.max(Moment[]); |
|
moment.min(Moment[,Moment...]); moment.min(Moment[]); |