• What is KendoReact
  • Getting Started
  • Server Components
  • Components
    • Animation
    • Barcodes
    • Buttons
    • Chartsupdated
    • Common Utilities
    • Conversational UIupdated
    • Data Gridupdated
    • Data Query
    • Data Tools
    • Date Inputs
    • Date Math
    • Dialogs
    • Drawing
    • Dropdownsupdated
    • Editor
    • Excel Export
    • File Saver
    • Formupdated
    • Ganttupdated
    • Gauges
    • Indicators
    • Inputsupdated
    • Labels
    • Layoutupdated
    • ListBoxupdated
    • ListView
    • Map
    • Notification
    • OrgChartnew
    • PDF Processing
    • PDFViewer
    • PivotGrid
    • Popup
    • Progress Bars
    • Ripple
    • Scheduler
    • ScrollView
    • Sortable
    • Spreadsheetupdated
    • TaskBoard
    • Tooltips
    • TreeList
    • TreeViewupdated
    • Upload
  • Sample Applications
  • Styling & Themes
  • Common Features
  • Project Setup
  • Knowledge Base
  • Changelog
  • Updates
  • Troubleshooting

weekInYear

A function that returns the number of the week within a year, which is calculated in relation to the date.

For more information, refer to the ISO week date article.

weekInYear(new Date(2016, 0, 1)); // Week 53, 2015
weekInYear(new Date(2016, 0, 5)); // Week 1, 2016
weekInYear(new Date(2017, 0, 1)); // Week 52, 2016
weekInYear(new Date(2017, 0, 2)); // Week 1, 2017

Parameters

date Date

The date used for the week number calculation.

weekStartDay Day

The first day of the week. By default, the first week day is Monday.

Returns

number - The number of the week within the year.

In this article

Not finding the help you need?