- MomentJS - Home
- MomentJS - Overview
- MomentJS - Environment Setup
- MomentJS - Introduction
- MomentJS - Parsing Date And Time
- MomentJS - Date Validation
- MomentJS - Getter/Setter
- Manipulate Date And Time
- Formatting Date And Time
- MomentJS - Date Queries
- MomentJS - Internationalization
- MomentJS - Customization
- MomentJS - Durations
- MomentJS - Utilities
- MomentJS - Plugins
- MomentJS - Examples
MomentJS - Week year
This method will get/set the week of the year. Its setting will depend on the locale. It will differ from based on country.
Syntax
moment().weekYear(Number); moment().weekYear();
Example
var m = moment().weekYear(); var d = moment().weekYear(2020);
Output
Week Year (ISO)
This method will get/set the week year in the ISO form.
Syntax
moment().isoWeekYear(Number); moment().isoWeekYear();
Example
var m = moment().isoWeekYear(); var d = moment().isoWeekYear(2020);
Output
momentjs_getter_setter.htm
Advertisements