Research
Security News
Threat Actor Exposes Playbook for Exploiting npm to Build Blockchain-Powered Botnets
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
gregorian-calendar
Advanced tools
gregorian calendar lib for browser and nodejs. ported from JAVA.
var GregorianCalendar = require('gregorian-calendar');
var date = new GregorianCalendar(require('gregorian-calendar/lib/locale/zh_CN')); // defaults to en_US
date.setTime(+new Date());
console.log(date.getDayOfWeek());
SUNDAY: 0,
/**
* Enum indicating monday
* @type Number
* @member Date.Gregorian
*/
MONDAY: 1,
/**
* Enum indicating tuesday
* @type Number
* @member Date.Gregorian
*/
TUESDAY: 2,
/**
* Enum indicating wednesday
* @type Number
* @member Date.Gregorian
*/
WEDNESDAY: 3,
/**
* Enum indicating thursday
* @type Number
* @member Date.Gregorian
*/
THURSDAY: 4,
/**
* Enum indicating friday
* @type Number
* @member Date.Gregorian
*/
FRIDAY: 5,
/**
* Enum indicating saturday
* @type Number
* @member Date.Gregorian
*/
SATURDAY: 6,
/**
* Enum indicating january
* @type Number
* @member Date.Gregorian
*/
JANUARY: 0,
/**
* Enum indicating february
* @type Number
* @member Date.Gregorian
*/
FEBRUARY: 1,
/**
* Enum indicating march
* @type Number
* @member Date.Gregorian
*/
MARCH: 2,
/**
* Enum indicating april
* @type Number
* @member Date.Gregorian
*/
APRIL: 3,
/**
* Enum indicating may
* @type Number
* @member Date.Gregorian
*/
MAY: 4,
/**
* Enum indicating june
* @type Number
* @member Date.Gregorian
*/
JUNE: 5,
/**
* Enum indicating july
* @type Number
* @member Date.Gregorian
*/
JULY: 6,
/**
* Enum indicating august
* @type Number
* @member Date.Gregorian
*/
AUGUST: 7,
/**
* Enum indicating september
* @type Number
* @member Date.Gregorian
*/
SEPTEMBER: 8,
/**
* Enum indicating october
* @type Number
* @member Date.Gregorian
*/
OCTOBER: 9,
/**
* Enum indicating november
* @type Number
* @member Date.Gregorian
*/
NOVEMBER: 10,
/**
* Enum indicating december
* @type Number
* @member Date.Gregorian
*/
DECEMBER: 11
same as call setYear, setMonth, setDayOfMonth ....
set absolute time for current instance
get absolute time for current instance
set current date instance's timezone offset (in minutes)
get current date instance's timezone offset (in minutes)
set the year of the given calendar field.
Returns the year of the given calendar field.
set the month of the given calendar field. January is 0, you can use enum
set the month of the given calendar field without influence month.
2015-09-29 -> setMonth(2) -> 2015-03-01
2015-09-29 -> rollSetMonth(2) -> 2015-02-28
Returns the month of the given calendar field.
set the day of month of the given calendar field.
Returns the day of month of the given calendar field.
set the hour of day for the given calendar field.
Returns the hour of day for the given calendar field.
set the minute of the given calendar field.
Returns the minute of the given calendar field.
set the second of the given calendar field.
Returns the second of the given calendar field.
set the millisecond of the given calendar field.
Returns the millisecond of the given calendar field.
Returns the week of year of the given calendar field.
Returns the week of month of the given calendar field.
Returns the day of year of the given calendar field.
Returns the day of week of the given calendar field. sunday is 0, monday is 1
Returns the day of week in month of the given calendar field.
add the year of the given calendar field.
add the month of the given calendar field.
add the day of month of the given calendar field.
add the hour of day of the given calendar field.
add the minute of the given calendar field.
add the second of the given calendar field.
add the millisecond of the given calendar field.
Returns the week number of year represented by this GregorianCalendar.
Sets this GregorianCalendar to the date given by the date specifiers - weekYear, weekOfYear, and dayOfWeek. weekOfYear follows the WEEK_OF_YEAR numbering. The dayOfWeek value must be one of the DAY_OF_WEEK values: SUNDAY to SATURDAY.
Returns the number of weeks in the week year
Returns a clone of current instance
clear all field of current instance
FAQs
date time utils ported from java
The npm package gregorian-calendar receives a total of 1,301 weekly downloads. As such, gregorian-calendar popularity was classified as popular.
We found that gregorian-calendar 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.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.