mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-05 10:49:36 +02:00
Show a report for total users chart
This commit is contained in:
parent
794938db72
commit
4d064adf1b
5397 changed files with 313100 additions and 365 deletions
43
node_modules/date-fns/startOfISOWeekYear.js
generated
vendored
Normal file
43
node_modules/date-fns/startOfISOWeekYear.js
generated
vendored
Normal file
|
@ -0,0 +1,43 @@
|
|||
import { constructFrom } from "./constructFrom.js";
|
||||
import { getISOWeekYear } from "./getISOWeekYear.js";
|
||||
import { startOfISOWeek } from "./startOfISOWeek.js";
|
||||
|
||||
/**
|
||||
* The {@link startOfISOWeekYear} function options.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @name startOfISOWeekYear
|
||||
* @category ISO Week-Numbering Year Helpers
|
||||
* @summary Return the start of an ISO week-numbering year for the given date.
|
||||
*
|
||||
* @description
|
||||
* Return the start of an ISO week-numbering year,
|
||||
* which always starts 3 days before the year's first Thursday.
|
||||
* The result will be in the local timezone.
|
||||
*
|
||||
* ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
|
||||
*
|
||||
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
|
||||
* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
|
||||
*
|
||||
* @param date - The original date
|
||||
* @param options - An object with options
|
||||
*
|
||||
* @returns The start of an ISO week-numbering year
|
||||
*
|
||||
* @example
|
||||
* // The start of an ISO week-numbering year for 2 July 2005:
|
||||
* const result = startOfISOWeekYear(new Date(2005, 6, 2))
|
||||
* //=> Mon Jan 03 2005 00:00:00
|
||||
*/
|
||||
export function startOfISOWeekYear(date, options) {
|
||||
const year = getISOWeekYear(date, options);
|
||||
const fourthOfJanuary = constructFrom(options?.in || date, 0);
|
||||
fourthOfJanuary.setFullYear(year, 0, 4);
|
||||
fourthOfJanuary.setHours(0, 0, 0, 0);
|
||||
return startOfISOWeek(fourthOfJanuary);
|
||||
}
|
||||
|
||||
// Fallback for modularized imports:
|
||||
export default startOfISOWeekYear;
|
Loading…
Add table
Add a link
Reference in a new issue