New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@beyonk/date-utils

Package Overview
Dependencies
Maintainers
0
Versions
55
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@beyonk/date-utils - npm Package Compare versions

Comparing version 4.9.0 to 4.9.1

10

lib/interval/format-finish.js

@@ -5,4 +5,8 @@ import { pluralize } from 'just-pluralize'

const defaultTranslate = ({ time }) => {
return `until ${time}`
}
function formatFinish ({ start, finish }, opts = {}) {
const { format, ...otherOpts } = opts
const { format, translate = defaultTranslate, ...otherOpts } = opts

@@ -20,4 +24,4 @@ switch (format) {

return finish.isSame(start, 'day')
? `until ${formatShortTime(finish, otherOpts)}`
: `until ${formatMediumDateTime(finish, otherOpts)}`
? translate({ time: formatShortTime(finish, otherOpts) })
: translate({ time: formatMediumDateTime(finish, otherOpts) })
}

@@ -24,0 +28,0 @@ }

@@ -25,2 +25,14 @@ import { expect } from '@hapi/code'

expectation: 'until Sun, 31 Oct, 14:15'
},
{
test: 'passed translate function',
interval: {
start: dayjs('2021-10-30T12:15'),
finish: dayjs('2021-10-31T14:15')
},
opts: {
locale: 'en-GB',
translate: ({ time }) => `finishes at ${time}`
},
expectation: 'finishes at Sun, 31 Oct, 14:15'
}

@@ -27,0 +39,0 @@ ]

{
"name": "@beyonk/date-utils",
"version": "4.9.0",
"version": "4.9.1",
"description": "Beyonk Date Utils",

@@ -40,2 +40,3 @@ "author": "Antony Jones <aj@desirableobjects.co.uk>",

},
"access": "restricted",
"scripts": {

@@ -42,0 +43,0 @@ "test": "NODE_ENV=test mocha './!(node_modules)/**/**.+(spec).js'",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc