Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

moment-parseformat

Package Overview
Dependencies
Maintainers
2
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

moment-parseformat - npm Package Compare versions

Comparing version 1.1.2 to 1.1.3

11

moment.parseFormat.js

@@ -59,2 +59,4 @@ /* istanbul ignore next */

var formatIncludesMonth = /([\/][M]|[M][\/]|[MM]|[MMMM])/
var regexFillingWords = /\b(at)\b/i

@@ -166,2 +168,11 @@

// to prevent 9.20 gets formated to D.Y, we format the complete date first, then go for the time
if (format.match(formatIncludesMonth)) {
var regexHoursDotWithLeadingZeroOrDoubleDigitMinutes = /0\d.\d{2}|\d{2}.\d{2}/
var regexHoursDotMinutes = /\d{1}.\d{2}/
format = format.replace(regexHoursDotWithLeadingZeroOrDoubleDigitMinutes, 'H.mm')
format = format.replace(regexHoursDotMinutes, 'h.mm')
}
// now, the next number, if existing, must be a day

@@ -168,0 +179,0 @@ format = format.replace(regexDayLeadingZero, 'DD')

2

package.json

@@ -41,3 +41,3 @@ {

},
"version": "1.1.2"
"version": "1.1.3"
}

@@ -76,3 +76,9 @@ 'use strict'

// https://github.com/gr2m/moment-parseformat/issues/19
t.equal(moment.parseFormat('February 6th, 2014 9.20'), 'MMMM Do, YYYY h.mm', 'February 6th, 2014 9.20 → MMMM Do, YYYY h.mm')
t.equal(moment.parseFormat('2.2.2014 09.20'), 'D.M.YYYY H.mm', '2.2.2014 09.20 → D.M.YYYY H.mm')
t.equal(moment.parseFormat('2.2.2014 11.20'), 'D.M.YYYY H.mm', '2.2.2014 11.20 → D.M.YYYY H.mm')
t.equal(moment.parseFormat('2.2.2014 9.02'), 'D.M.YYYY h.mm', '2.2.2014 9.02 → D.M.YYYY h.mm')
t.end()
})
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