Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
moment-he
Advanced tools
Readme
Human Era format for moment.js.
yarn add moment-he
const moment = require('moment-he')
const now = moment()
// Base formats
now.humanEra('YY') // 17 (doesn't apply for short format)
now.humanEra('YYYY') // 12017
now.humanEra('Y') // 12017
now.humanEra('gggg') // 12017
now.humanEra('GGGG') // 12017
// Base formats (with suffix)
now.humanEra('YY', true) // 17
now.humanEra('YYYY', true) // 12017 HE
now.humanEra('Y', true) // 12017 HE
now.humanEra('gggg', true) // 12017 HE
now.humanEra('GGGG', true) // 12017 HE
// Localized formats
now.humanEra('L') // 08/06/12017
now.humanEra('l') // 8/6/12017
now.humanEra('LL') // August 6, 12017
now.humanEra('ll') // Aug 6, 12017
now.humanEra('LLL') // August 6, 12017 2:36 PM
now.humanEra('lll') // Aug 6, 12017 2:36 PM
now.humanEra('LLLL') // Sunday, August 6, 12017 2:36 PM
now.humanEra('llll') // Sun, Aug 6, 12017 2:36 PM
// Localized formats (with suffix)
now.humanEra('L', true) // 08/06/12017 HE
now.humanEra('l', true) // 8/6/12017 HE
now.humanEra('LL', true) // August 6, 12017 HE
now.humanEra('ll', true) // Aug 6, 12017 HE
now.humanEra('LLL', true) // August 6, 12017 HE 2:42 PM
now.humanEra('lll', true) // Aug 6, 12017 HE 2:42 PM
now.humanEra('LLLL', true) // Sunday, August 6, 12017 HE 2:42 PM
now.humanEra('llll', true) // Sun, Aug 6, 12017 HE 2:42 PM
The only new API is the moment().humanEra()
method (also aliased as moment().he()
).
It works exactly like moment().format()
, the only difference being that it returns years in the Holocene Calendar instead of ISO 8601.
moment().humanEra(format[, suffix])
format
(string): exact same requirements as moment().format()
suffix
(boolean): whether to display an extra 'HE' after each year, defaults to false
A string, very similar to what moment().format(format)
would return but with HE years!
FAQs
Human Era format for moment.js
The npm package moment-he receives a total of 1 weekly downloads. As such, moment-he popularity was classified as not popular.
We found that moment-he demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.