mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-06 03:50:04 +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
31
node_modules/date-fns/daysToWeeks.cjs
generated
vendored
Normal file
31
node_modules/date-fns/daysToWeeks.cjs
generated
vendored
Normal file
|
@ -0,0 +1,31 @@
|
|||
"use strict";
|
||||
exports.daysToWeeks = daysToWeeks;
|
||||
var _index = require("./constants.cjs");
|
||||
|
||||
/**
|
||||
* @name daysToWeeks
|
||||
* @category Conversion Helpers
|
||||
* @summary Convert days to weeks.
|
||||
*
|
||||
* @description
|
||||
* Convert a number of days to a full number of weeks.
|
||||
*
|
||||
* @param days - The number of days to be converted
|
||||
*
|
||||
* @returns The number of days converted in weeks
|
||||
*
|
||||
* @example
|
||||
* // Convert 14 days to weeks:
|
||||
* const result = daysToWeeks(14)
|
||||
* //=> 2
|
||||
*
|
||||
* @example
|
||||
* // It uses trunc rounding:
|
||||
* const result = daysToWeeks(13)
|
||||
* //=> 1
|
||||
*/
|
||||
function daysToWeeks(days) {
|
||||
const result = Math.trunc(days / _index.daysInWeek);
|
||||
// Prevent negative zero
|
||||
return result === 0 ? 0 : result;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue