registration
This commit is contained in:
13
frontend/style/node_modules/date-fns/getUnixTime.js
generated
vendored
13
frontend/style/node_modules/date-fns/getUnixTime.js
generated
vendored
@@ -1,6 +1,4 @@
|
||||
"use strict";
|
||||
exports.getUnixTime = getUnixTime;
|
||||
var _index = require("./toDate.js");
|
||||
import { toDate } from "./toDate.js";
|
||||
|
||||
/**
|
||||
* @name getUnixTime
|
||||
@@ -10,8 +8,6 @@ var _index = require("./toDate.js");
|
||||
* @description
|
||||
* Get the seconds timestamp of the given 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).
|
||||
*
|
||||
* @param date - The given date
|
||||
*
|
||||
* @returns The timestamp
|
||||
@@ -21,6 +17,9 @@ var _index = require("./toDate.js");
|
||||
* const result = getUnixTime(new Date(2012, 1, 29, 11, 45, 5))
|
||||
* //=> 1330512305
|
||||
*/
|
||||
function getUnixTime(date) {
|
||||
return Math.trunc(+(0, _index.toDate)(date) / 1000);
|
||||
export function getUnixTime(date) {
|
||||
return Math.trunc(+toDate(date) / 1000);
|
||||
}
|
||||
|
||||
// Fallback for modularized imports:
|
||||
export default getUnixTime;
|
||||
|
||||
Reference in New Issue
Block a user