Security News
Cloudflare Adds Security.txt Setup Wizard
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
gregorian-calendar-format
Advanced tools
format gregorian-calendar instance
var GregorianCalendarFormat = require('gregorian-calendar-format');
var GregorianCalendar = require('gregorian-calendar');
var gregorianCalendar = new GregorianCalendar(2013,
GregorianCalendar.JULY, 9);
var df = new GregorianCalendarFormat('yyyy-MM-dd');
console.log(df.format(gregorianCalendar));
df = new GregorianCalendarFormat('yy-MM-dd');
console.log(df.format(gregorianCalendar));
Letter | Date or Time Component | Presentation | Examples |
---|---|---|---|
G | Era designator | Text | AD |
y | Year | Year | 1996; 96 |
M | Month in year | Month | number of M matter. such as: MM:01 MMM:Jan MMMM: January |
w | Week in year | Number | 27 |
W | Week in month | Number | 2 |
D | Day in year | Number | 189 |
d | Day in month | Number | 10 |
F | Day of week in month | Number | 2 |
E | Day in week | Text | number of E matter. such as: EEEE: Sunday, EEE: Sun |
a | Am/pm marker | Text | PM |
H | Hour in day (0-23) | Number | 0 |
k | Hour in day (1-24) | Number | 24 |
K | Hour in am/pm (0-11) | Number | 0 |
h | Hour in am/pm (1-12) | Number | 12 |
m | Minute in hour | Number | 30 |
s | Second in minute | Number | 55 |
S | Millisecond | Number | 978 |
x/z | Time zone | General time zone | Pacific Standard Time; PST; GMT-08:00 |
Z | Time zone | RFC 822 time zone | -0800 |
such as "yyyy-MM-dd'日'" will parse and format "2013-11-12日" "2013-01-02日". (content inside '' will preserve)
format an instance of GregorianCalendar according to pattern
parse a dateString to an instance of GregorianCalendar according to pattern, it's better to specify calendarLocale, such as
df.parse('2013-11-12', require('gregorian-calendar/lib/locale/zh-cn'));
get a predefine GregorianCalendarFormat instance
FAQs
format utils for gregorian-calendar
The npm package gregorian-calendar-format receives a total of 1,331 weekly downloads. As such, gregorian-calendar-format popularity was classified as popular.
We found that gregorian-calendar-format 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
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.
Security News
ENISA’s 2024 report highlights the EU’s top cybersecurity threats, including rising DDoS attacks, ransomware, supply chain vulnerabilities, and weaponized AI.