@beyonk/date-utils
Advanced tools
Comparing version 1.1.0 to 1.2.0
@@ -6,2 +6,3 @@ import dayjs from 'dayjs/esm' | ||
import isSameOrAfter from 'dayjs/plugin/isSameOrAfter' | ||
import duration from 'dayjs/plugin/duration' | ||
import utc from 'dayjs/plugin/utc' | ||
@@ -12,2 +13,3 @@ import timeZone from './plugin/timezone.plugin' | ||
dayjs.extend(relativeTime) | ||
dayjs.extend(duration) | ||
dayjs.extend(isSameOrBefore) | ||
@@ -90,6 +92,2 @@ dayjs.extend(isSameOrAfter) | ||
function minsToDays (mins) { | ||
return mins ? Math.ceil(mins / 24 / 60) : 0 | ||
} | ||
function toTimeless (date) { | ||
@@ -114,4 +112,3 @@ return dayjs(date).format('YYYY-MM-DD') | ||
minsToTime, | ||
timeToMins, | ||
minsToDays | ||
timeToMins | ||
} |
@@ -1,2 +0,2 @@ | ||
import { repeatSchedule, utcDate, minsToTime, timeToMins, minsToDays } from './date-utils.js' | ||
import { repeatSchedule, utcDate, minsToTime, timeToMins } from './date-utils.js' | ||
import { expect } from '@hapi/code' | ||
@@ -88,36 +88,2 @@ | ||
}) | ||
describe('#minsToTime()', () => { | ||
it('converts undefined to 0', () => { | ||
expect( | ||
minsToDays(undefined) | ||
).to.equal( | ||
0 | ||
) | ||
}) | ||
it('converts 0 to 0', () => { | ||
expect( | ||
minsToDays(0) | ||
).to.equal( | ||
0 | ||
) | ||
}) | ||
it('converts 640 to 1', () => { | ||
expect( | ||
minsToDays(640) | ||
).to.equal( | ||
1 | ||
) | ||
}) | ||
it('converts 2488 to 2', () => { | ||
expect( | ||
minsToDays(2488) | ||
).to.equal( | ||
2 | ||
) | ||
}) | ||
}) | ||
}) |
{ | ||
"name": "@beyonk/date-utils", | ||
"version": "1.1.0", | ||
"version": "1.2.0", | ||
"description": "Beyonk Date Utils", | ||
@@ -29,3 +29,3 @@ "author": "Antony Jones <aj@desirableobjects.co.uk>", | ||
}, | ||
"gitHead": "f1e45d9779404cd430ed05af9d52b0e2cd22362c" | ||
"gitHead": "e987cf0105450513288c3a9451b695e9b40c324d" | ||
} |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
0
10548
311