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

gregorian-calendar

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gregorian-calendar - npm Package Compare versions

Comparing version 4.0.2 to 4.0.3

23

lib/gregorian-calendar.js

@@ -37,3 +37,3 @@ /*

*/
this.time = Date.now();
this.time = undefined;
/*

@@ -459,9 +459,9 @@ * The timezoneOffset in minutes used by this date.

computeTime: function computeTime() {
if (!this.isSet(YEAR)) {
throw new Error('year must be set for GregorianCalendar');
var year = undefined;
var fields = this.fields;
if (this.isSet(YEAR)) {
year = fields[YEAR];
} else {
year = new Date().getFullYear();
}
var fields = this.fields;
var year = fields[YEAR];
var timeOfDay = 0;

@@ -477,16 +477,9 @@ if (this.isSet(HOUR_OF_DAY)) {

timeOfDay += fields[MILLISECONDS] || 0;
var fixedDate = 0;
fields[YEAR] = year;
fixedDate = fixedDate + this.getFixedDate();
// millis represents local wall-clock time in milliseconds.
var millis = (fixedDate - EPOCH_OFFSET) * ONE_DAY + timeOfDay;
millis -= this.timezoneOffset * ONE_MINUTE;
this.time = millis;
this.computeFields();

@@ -579,3 +572,3 @@ },

fixedDate += fields[DAY_OF_YEAR] - 1;
} else {
} else if (self.isSet(WEEK_OF_YEAR)) {
firstDayOfWeek = getDayOfWeekDateOnOrBefore(fixedDate + 6, firstDayOfWeekCfg);

@@ -582,0 +575,0 @@ // If we have enough days in the first week, then move

{
"name": "gregorian-calendar",
"version": "4.0.2",
"version": "4.0.3",
"author": "yiminghe <yiminghe@gmail.com>",

@@ -5,0 +5,0 @@ "description": "date time utils ported from java",

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