Socket
Socket
Sign inDemoInstall

@beyonk/date-utils

Package Overview
Dependencies
2
Maintainers
4
Versions
54
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 4.7.6 to 4.7.7

6

lib/date/format.js

@@ -13,3 +13,7 @@ import dayjs from 'dayjs'

}
return Intl.DateTimeFormat(locale, config).format(date)
try {
return Intl.DateTimeFormat(locale, config).format(date)
} catch (e) {
return 'Invalid Date'
}
}

@@ -16,0 +20,0 @@

import { expect } from '@hapi/code'
import dayjs from 'dayjs'
import {

@@ -147,2 +148,12 @@ formatLongDate,

})
context('Invalid date', () => {
it('invalid dayjs', () => {
expect(formatLongDate(dayjs(''))).to.equal('Invalid Date')
})
it('invalid Date', () => {
expect(formatLongDate(new Date('ABC'))).to.equal('Invalid Date')
})
})
})

2

package.json
{
"name": "@beyonk/date-utils",
"version": "4.7.6",
"version": "4.7.7",
"description": "Beyonk Date Utils",

@@ -5,0 +5,0 @@ "author": "Antony Jones <aj@desirableobjects.co.uk>",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc