Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/datetime-class.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
import { MILLISECONDS_PER_WEEK } from './utils/const.js'
import { datetime, weekNumber } from './index.js'
import { getNormalizeDay } from './utils/date.js'

export class DateTime extends Date {

/**
* Get the day index of the week, except Sunday is 7 instead of 0.
*
* @returns {number}
*/
getNormalisedDay = () => getNormalizeDay(this)
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be getNormalizedDay with a z instead of a s.


/**
* Returns the week of the year (`1`–`53`) of the specified date according to
* local time, as defined by the WHATWG and the ISO-8601 specs:
Expand Down
2 changes: 2 additions & 0 deletions src/datetime-class.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ describe('DateTime class', () => {
})
})

describe.todo('.getNormalisedDay()', () => {})

describe('.getWeek()', () => {

test('returns the week number', () => {
Expand Down