registration
This commit is contained in:
14
frontend/style/node_modules/date-fns/daysToWeeks.js
generated
vendored
14
frontend/style/node_modules/date-fns/daysToWeeks.js
generated
vendored
@@ -1,6 +1,4 @@
|
||||
"use strict";
|
||||
exports.daysToWeeks = daysToWeeks;
|
||||
var _index = require("./constants.js");
|
||||
import { daysInWeek } from "./constants.js";
|
||||
|
||||
/**
|
||||
* @name daysToWeeks
|
||||
@@ -10,8 +8,6 @@ var _index = require("./constants.js");
|
||||
* @description
|
||||
* Convert a number of days to a full number of weeks.
|
||||
*
|
||||
* @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).
|
||||
*
|
||||
* @param days - The number of days to be converted
|
||||
*
|
||||
* @returns The number of days converted in weeks
|
||||
@@ -26,9 +22,11 @@ var _index = require("./constants.js");
|
||||
* const result = daysToWeeks(13)
|
||||
* //=> 1
|
||||
*/
|
||||
function daysToWeeks(days) {
|
||||
const weeks = days / _index.daysInWeek;
|
||||
const result = Math.trunc(weeks);
|
||||
export function daysToWeeks(days) {
|
||||
const result = Math.trunc(days / daysInWeek);
|
||||
// Prevent negative zero
|
||||
return result === 0 ? 0 : result;
|
||||
}
|
||||
|
||||
// Fallback for modularized imports:
|
||||
export default daysToWeeks;
|
||||
|
||||
Reference in New Issue
Block a user