• Getting Started
  • Components
    • Barcodes
    • Buttons
    • Chartsupdated
    • Conversational UIupdated
    • Data Query
    • Date Inputsupdated
    • Date Math
    • Dialogs
    • Drawing
    • Dropdownsupdated
    • Editor
    • Excel Export
    • File Saver
    • Filter
    • Gantt
    • Gauges
    • Gridupdated
    • Icons
    • Indicators
    • Inputsupdated
    • Labels
    • Layout
    • ListBox
    • ListView
    • Map
    • Menus
    • Navigation
    • Notification
    • Pager
    • PDF Export
    • PDFViewer
    • PivotGridupdated
    • Popup
    • ProgressBars
    • Ripple
    • Schedulerupdated
    • ScrollView
    • Sortable
    • Spreadsheetupdated
    • ToolBar
    • Tooltips
    • TreeList
    • TreeView
    • Typography
    • Uploads
    • Utilities
  • Styling & Themes
  • Common Features
  • Project Setup
  • Knowledge Base
  • Sample Applications
  • FAQ
  • Troubleshooting
  • Updates
  • Changelogs
New to Kendo UI for Angular? Start a free 30-day trial

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?