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

js-joda

Package Overview
Dependencies
Maintainers
2
Versions
63
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

js-joda - npm Package Compare versions

Comparing version 1.5.2 to 1.5.3

11

CHANGELOG.md
Changelog
=========
### 1.5.3 (next)
### 1.5.4 (next)
### 1.5.3
#### public API
* fail if temporals ar created with float values
* fix typescript definition and esdoc
#### dependency updates
### 1.5.2

@@ -7,0 +16,0 @@

58

dist/js-joda.d.ts

@@ -53,3 +53,3 @@ declare namespace JSJoda {

isSupported(field: TemporalField): number
isSupported(field: TemporalField): boolean

@@ -116,3 +116,3 @@ minus(days: number): DayOfWeek

minus(durationOrNumber: Duration | number, unit: ChronoUnit): Duration
minus(durationOrNumber: Duration|number, unit: ChronoUnit): Duration

@@ -141,3 +141,3 @@ minusAmountUnit(amountToSubtract: number, unit: TemporalUnit): Duration

plus(durationOrNumber: Duration | number, unitOrNumber: TemporalUnit | number): Duration
plus(durationOrNumber: Duration|number, unitOrNumber: TemporalUnit|number): Duration

@@ -199,3 +199,3 @@ plusAmountUnit(amountToAdd: number, unit: TemporalUnit): Duration

static ofEpochSecond(epochSecond: number, nanoAdjustment: number): Instant
static ofEpochSecond(epochSecond: number, nanoAdjustment?: number): Instant

@@ -222,3 +222,3 @@ static parse(text: string): Instant

isSupported(fieldOrUnit: TemporalField | TemporalUnit): boolean
isSupported(fieldOrUnit: TemporalField|TemporalUnit): boolean

@@ -295,3 +295,3 @@ minus(amount: TemporalAmount): Instant

toString(): any
toString(): string

@@ -367,3 +367,3 @@ withChronology(chrono: any): any

static now(clockOrZone?: Clock | ZoneId): LocalTime
static now(clockOrZone?: Clock|ZoneId): LocalTime

@@ -386,3 +386,3 @@ static of(hour?: number, minute?: number, second?: number, nanoOfSecond?: number): LocalTime

equals(other: any): any
equals(other: any): boolean

@@ -399,7 +399,7 @@ format(formatter: DateTimeFormatter): string

isAfter(other: LocalTime): any
isAfter(other: LocalTime): boolean
isBefore(other: LocalTime): any
isBefore(other: LocalTime): boolean
isSupported(fieldOrUnit: ChronoField | ChronoUnit): boolean
isSupported(fieldOrUnit: ChronoField|ChronoUnit): boolean

@@ -543,5 +543,5 @@ minus(amount: TemporalAmount): LocalTime

static now(arg1?: ZoneId | Clock): MonthDay
static now(arg1?: ZoneId|Clock): MonthDay
static of(monthOrNumber: Month | number, number?: number): MonthDay
static of(monthOrNumber: Month|number, number?: number): MonthDay

@@ -898,3 +898,3 @@ static ofMonthNumber(month: Month, dayOfMonth: number): MonthDay

isSupported(fieldOrUnit: TemporalField | TemporalUnit): boolean
isSupported(fieldOrUnit: TemporalField|TemporalUnit): boolean

@@ -980,3 +980,3 @@ minus(amount: TemporalAmount): LocalDateTime

withMonth(month: number | Month): LocalDateTime
withMonth(month: number|Month): LocalDateTime

@@ -1162,3 +1162,3 @@ withNano(nanoOfSecond: number): LocalDateTime

static now(zoneIdOrClock?: ZoneId | Clock): Year
static now(zoneIdOrClock?: ZoneId|Clock): Year

@@ -1169,7 +1169,7 @@ static of(isoYear: number): Year

atMonth(monthOrNumber: Month | number): Year
atMonth(monthOrNumber: Month|number): Year
plus(amountOrNumber: TemporalAmount | number, unit?: TemporalUnit): Year
plus(amountOrNumber: TemporalAmount|number, unit?: TemporalUnit): Year
minus(amountOrNumber: TemporalAmount | number, unit?: TemporalUnit): Year
minus(amountOrNumber: TemporalAmount|number, unit?: TemporalUnit): Year
}

@@ -1179,15 +1179,15 @@ class YearMonth extends Temporal {

static now(zoneIdOrClock?: ZoneId | Clock): YearMonth
static now(zoneIdOrClock?: ZoneId|Clock): YearMonth
static of(year: number, monthOrNumber: Month | number): YearMonth
static of(year: number, monthOrNumber: Month|number): YearMonth
static parse(text: string, formatter?: DateTimeFormatter): YearMonth
minus(amountOrNumber: TemporalAmount | number, unit?: TemporalUnit): YearMonth
minus(amountOrNumber: TemporalAmount|number, unit?: TemporalUnit): YearMonth
plus(amountOrNumber: TemporalAmount | number, unit?: TemporalUnit): YearMonth
plus(amountOrNumber: TemporalAmount|number, unit?: TemporalUnit): YearMonth
with(adjusterOrField: TemporalAdjuster | TemporalField, value?: number): YearMonth
with(adjusterOrField: TemporalAdjuster|TemporalField, value?: number): YearMonth
isSupported(fieldOrUnit: TemporalField | ChronoUnit): boolean
isSupported(fieldOrUnit: TemporalField|ChronoUnit): boolean
}

@@ -1256,3 +1256,3 @@ class ZoneId {

class ZoneRegion extends ZoneId {
static ofId(zoneId: any): ZoneId
static ofId(zoneId: string): ZoneId

@@ -1301,3 +1301,3 @@ id(): string

static now(clockOrZone?: Clock | ZoneId): ZonedDateTime
static now(clockOrZone?: Clock|ZoneId): ZonedDateTime

@@ -1325,3 +1325,3 @@ static of(): any

equals(other: any): any
equals(other: any): boolean

@@ -1338,3 +1338,3 @@ format(formatter: DateTimeFormatter): string

isSupported(fieldOrUnit: TemporalField | TemporalUnit): boolean
isSupported(fieldOrUnit: TemporalField|TemporalUnit): boolean

@@ -1341,0 +1341,0 @@ minus(): any

{
"name": "js-joda",
"version": "1.5.2",
"version": "1.5.3",
"description": "a date and time library for javascript",

@@ -10,3 +10,12 @@ "repository": {

"main": "dist/js-joda.js",
"module": "src/js-joda.js",
"typings": "dist/js-joda.d.ts",
"files": [
"dist",
"src",
"bower.json",
"CHANGELOG.md",
"CheatSheet.md",
"README.md"
],
"scripts": {

@@ -25,3 +34,3 @@ "prepublish": "npm run build-dist",

"build-gz-check": "gzip -kf dist/js-joda.min.js && ls -alh ./dist/js-joda.min.js*",
"lint": "./node_modules/.bin/eslint ."
"lint": "./node_modules/.bin/eslint ./src ./test"
},

@@ -41,16 +50,17 @@ "keywords": [

"babel-cli": "^6.24.1",
"babel-core": "^6.24.1",
"babel-loader": "^6.4.1",
"babel-plugin-istanbul": "^4.1.1",
"babel-core": "^6.25.0",
"babel-loader": "^7.1.1",
"babel-plugin-istanbul": "^4.1.4",
"babel-preset-es2015": "^6.24.1",
"chai": "^3.5.0",
"coveralls": "^2.13.0",
"esdoc": "^0.5.2",
"eslint": "^3.19.0",
"eslint-config-standard": "^10.2.0",
"chai": "^4.1.0",
"coveralls": "^2.13.1",
"esdoc": "^1.0.1",
"esdoc-standard-plugin": "^1.0.0",
"eslint": "^4.3.0",
"eslint-config-standard": "^10.2.1",
"eslint-plugin-promise": "^3.5.0",
"eslint-plugin-standard": "^3.0.1",
"karma": "^1.6.0",
"karma": "^1.7.0",
"karma-chai-plugins": "^0.9.0",
"karma-chrome-launcher": "^2.0.0",
"karma-chrome-launcher": "^2.2.0",
"karma-firefox-launcher": "^1.0.1",

@@ -61,11 +71,11 @@ "karma-mocha": "^1.3.0",

"karma-sourcemap-loader": "^0.3.7",
"karma-webpack": "^2.0.3",
"karma-webpack": "^2.0.4",
"markdown-toc": "^1.1.0",
"mocha": "^3.2.0",
"nyc": "^10.2.0",
"mocha": "^3.4.2",
"nyc": "^11.1.0",
"phantomjs-prebuilt": "^2.1.14",
"typescript": "^2.2.2",
"webpack": "^2.3.3"
"typescript": "^2.4.2",
"webpack": "^3.4.1"
},
"license": "BSD-3-Clause"
}

@@ -5,3 +5,3 @@ Immutable date and time library for javascript

[![npm version](https://badge.fury.io/js/js-joda.svg)](https://badge.fury.io/js/js-joda)
[![Build Status](https://travis-ci.org/js-joda/js-joda.svg)](https://travis-ci.org/js-joda/js-joda)
[![Build Status](https://travis-ci.org/js-joda/js-joda.svg?branch=master)](https://travis-ci.org/js-joda/js-joda)
[![Sauce Test Status](https://saucelabs.com/buildstatus/js-joda)](https://saucelabs.com/u/js-joda)

@@ -79,11 +79,11 @@ [![Coverage Status](https://coveralls.io/repos/js-joda/js-joda/badge.svg?branch=master&service=github)](https://coveralls.io/github/js-joda/js-joda?branch=master)

Install joda using npm
```bash
npm install js-joda
```
Then require it to any module
```javascript
var LocalDate = require('js-joda').LocalDate;
var d = LocalDate.parse('2012-12-24').atStartOfDay().plusMonths(2); // 2013-02-24T00:00:00
```
### Browser

@@ -94,3 +94,3 @@

Then add it as a script tag to your page
```html
<script src="js-joda.min.js"></script>

@@ -101,3 +101,3 @@ <script>

</script>
```
## Documentation

@@ -104,0 +104,0 @@

@@ -53,3 +53,3 @@ /*

export class ChronoLocalDateTime extends Temporal {
/* <D extends ChronoLocalDate>
/* <D extends ChronoLocalDate>
extends DefaultInterfaceTemporal

@@ -93,4 +93,4 @@ implements Temporal, TemporalAdjuster, Comparable<ChronoLocalDateTime<?>> */

return temporal
.with(ChronoField.EPOCH_DAY, this.toLocalDate().toEpochDay())
.with(ChronoField.NANO_OF_DAY, this.toLocalTime().toNanoOfDay());
.with(ChronoField.EPOCH_DAY, this.toLocalDate().toEpochDay())
.with(ChronoField.NANO_OF_DAY, this.toLocalTime().toNanoOfDay());
}

@@ -97,0 +97,0 @@

@@ -134,3 +134,3 @@ /**

}
/*
/*
if (fieldValues.containsKey(ALIGNED_WEEK_OF_MONTH)) {

@@ -137,0 +137,0 @@ if (fieldValues.containsKey(ALIGNED_DAY_OF_WEEK_IN_MONTH)) {

@@ -59,4 +59,4 @@ /**

super();
this._seconds = seconds;
this._nanos = nanos;
this._seconds = MathUtil.safeToInt(seconds);
this._nanos = MathUtil.safeToInt(nanos);
}

@@ -63,0 +63,0 @@

@@ -258,12 +258,12 @@ /*

}
// if (timeFields.containsKey(HOUR_OF_DAY) && timeFields.containsKey(MINUTE_OF_HOUR)) {
// const hod = timeFields.remove(HOUR_OF_DAY);
// const moh = timeFields.remove(MINUTE_OF_HOUR);
// this._addFieldValue(MINUTE_OF_DAY, hod * 60 + moh);
// }
// if (timeFields.containsKey(MINUTE_OF_DAY) && timeFields.containsKey(SECOND_OF_MINUTE)) {
// const mod = timeFields.remove(MINUTE_OF_DAY);
// const som = timeFields.remove(SECOND_OF_MINUTE);
// this._addFieldValue(SECOND_OF_DAY, mod * 60 + som);
// }
// if (timeFields.containsKey(HOUR_OF_DAY) && timeFields.containsKey(MINUTE_OF_HOUR)) {
// const hod = timeFields.remove(HOUR_OF_DAY);
// const moh = timeFields.remove(MINUTE_OF_HOUR);
// this._addFieldValue(MINUTE_OF_DAY, hod * 60 + moh);
// }
// if (timeFields.containsKey(MINUTE_OF_DAY) && timeFields.containsKey(SECOND_OF_MINUTE)) {
// const mod = timeFields.remove(MINUTE_OF_DAY);
// const som = timeFields.remove(SECOND_OF_MINUTE);
// this._addFieldValue(SECOND_OF_DAY, mod * 60 + som);
// }
if (this.fieldValues.containsKey(ChronoField.NANO_OF_DAY)) {

@@ -311,7 +311,7 @@ const nod = this.fieldValues.remove(ChronoField.NANO_OF_DAY);

// const sod = MathUtil.intDiv(nod, 1000000000L);
// this._addFieldValue(HOUR_OF_DAY, MathUtil.intDiv(sod, 3600));
// this._addFieldValue(MINUTE_OF_HOUR, MathUtil.intMod(MathUtil.intDiv(sod, 60), 60));
// this._addFieldValue(SECOND_OF_MINUTE, MathUtil.intMod(sod, 60));
// this._addFieldValue(NANO_OF_SECOND, MathUtil.intMod(nod, 1000000000L));
// const sod = MathUtil.intDiv(nod, 1000000000L);
// this._addFieldValue(HOUR_OF_DAY, MathUtil.intDiv(sod, 3600));
// this._addFieldValue(MINUTE_OF_HOUR, MathUtil.intMod(MathUtil.intDiv(sod, 60), 60));
// this._addFieldValue(SECOND_OF_MINUTE, MathUtil.intMod(sod, 60));
// this._addFieldValue(NANO_OF_SECOND, MathUtil.intMod(nod, 1000000000L));
if (resolverStyle !== ResolverStyle.LENIENT) {

@@ -318,0 +318,0 @@ if (this.fieldValues.containsKey(ChronoField.MILLI_OF_SECOND)) {

@@ -614,2 +614,6 @@ /**

/**
*
* @returns {string}
*/
toString() {

@@ -616,0 +620,0 @@ const pattern = this._printerParser.toString();

@@ -253,4 +253,4 @@ /**

Instant._validate(seconds, nanoOfSecond);
this._seconds = seconds;
this._nanos = nanoOfSecond;
this._seconds = MathUtil.safeToInt(seconds);
this._nanos = MathUtil.safeToInt(nanoOfSecond);
}

@@ -1035,2 +1035,10 @@

}
/**
*
* @return {string} same as {@link LocalDate.toString}
*/
toJSON() {
return this.toString();
}
}

@@ -1037,0 +1045,0 @@

@@ -278,6 +278,6 @@ /**

super();
const _hour = MathUtil.safeZero(hour);
const _minute = MathUtil.safeZero(minute);
const _second = MathUtil.safeZero(second);
const _nanoOfSecond = MathUtil.safeZero(nanoOfSecond);
const _hour = MathUtil.safeToInt(hour);
const _minute = MathUtil.safeToInt(minute);
const _second = MathUtil.safeToInt(second);
const _nanoOfSecond = MathUtil.safeToInt(nanoOfSecond);
LocalTime._validate(_hour, _minute, _second, _nanoOfSecond);

@@ -1198,3 +1198,3 @@ if ((_minute | _second | _nanoOfSecond) === 0) {

*/
/*
/*
atOffset(offset) {

@@ -1264,3 +1264,3 @@ return OffsetTime.of(this, offset);

* @param {LocalTime} other - the other time to compare to, not null
* @return {boolean}true if this is after the specified time
* @return {boolean} true if this is after the specified time
* @throws {NullPointerException} if `other` is null

@@ -1278,3 +1278,3 @@ */

* @param {LocalTime} other - the other time to compare to, not null
* @return {boolean}true if this point is before the specified time
* @return {boolean} true if this point is before the specified time
* @throws {NullPointerException} if `other` is null

@@ -1297,3 +1297,3 @@ */

* @param {*} other - the object to check, null returns false
* @return {boolean}true if this is equal to the other time
* @return {boolean} true if this is equal to the other time
*/

@@ -1300,0 +1300,0 @@ equals(other) {

@@ -171,2 +171,5 @@ /**

}
if ((value % 1) !== 0) {
throw new ArithmeticException(`Invalid value: '${value}' is a float`);
}
if (value > MAX_SAFE_INTEGER || value < MIN_SAFE_INTEGER) {

@@ -173,0 +176,0 @@ throw new ArithmeticException('Calculation overflows an int: ' + value);

@@ -49,3 +49,3 @@ /**

super();
this._value = value;
this._value = MathUtil.safeToInt(value);
}

@@ -52,0 +52,0 @@

@@ -8,2 +8,3 @@ /*

import {DateTimeException, UnsupportedTemporalTypeException} from './errors';
import {MathUtil} from './MathUtil';

@@ -286,4 +287,4 @@ import {ChronoField} from './temporal/ChronoField';

super();
this._month = month;
this._day = dayOfMonth;
this._month = MathUtil.safeToInt(month);
this._day = MathUtil.safeToInt(dayOfMonth);
}

@@ -290,0 +291,0 @@

@@ -190,3 +190,3 @@ /*

}
/*
/*
if (amount instanceof ChronoPeriod) {

@@ -626,5 +626,5 @@ if (IsoChronology.INSTANCE !== amount.chronology()) {

return Period.create(
MathUtil.safeSubtract(this._years, amount._years),
MathUtil.safeSubtract(this._months, amount._months),
MathUtil.safeSubtract(this._days, amount._days));
MathUtil.safeSubtract(this._years, amount._years),
MathUtil.safeSubtract(this._months, amount._months),
MathUtil.safeSubtract(this._days, amount._days));
}

@@ -700,5 +700,5 @@

return Period.create(
MathUtil.safeMultiply(this._years, scalar),
MathUtil.safeMultiply(this._months, scalar),
MathUtil.safeMultiply(this._days, scalar));
MathUtil.safeMultiply(this._years, scalar),
MathUtil.safeMultiply(this._months, scalar),
MathUtil.safeMultiply(this._days, scalar));
}

@@ -705,0 +705,0 @@

@@ -218,3 +218,3 @@ /**

/* TODO: classes not implemented yet */
/*
/*
if (temporal instanceof ChronoLocalDate) {

@@ -221,0 +221,0 @@ return isDateBased();

@@ -79,3 +79,3 @@ /**

super();
this._year = value;
this._year = MathUtil.safeToInt(value);
}

@@ -82,0 +82,0 @@

@@ -266,4 +266,4 @@ /*

super();
this._year = year;
this._month = month;
this._year = MathUtil.safeToInt(year);
this._month = MathUtil.safeToInt(month);
}

@@ -270,0 +270,0 @@

@@ -189,4 +189,4 @@ /*

//-----------------------------------------------------------------------
/**
//-----------------------------------------------------------------------
/**
* Checks if this time-zone ID is equal to another time-zone ID.

@@ -209,3 +209,3 @@ *

/**
/**
* A hash code for this time-zone ID.

@@ -219,4 +219,4 @@ *

//-----------------------------------------------------------------------
/**
//-----------------------------------------------------------------------
/**
* Outputs this zone as a string, using the ID.

@@ -223,0 +223,0 @@ *

@@ -44,3 +44,3 @@ /**

ZoneOffset._validateTotalSeconds(totalSeconds);
this._totalSeconds = totalSeconds;
this._totalSeconds = MathUtil.safeToInt(totalSeconds);
this._rules = ZoneRules.of(this);

@@ -341,3 +341,3 @@ this._id = ZoneOffset._buildId(totalSeconds);

/**
/**
* Gets the value of the specified field from this offset as a `long`.

@@ -372,4 +372,4 @@ *

//-----------------------------------------------------------------------
/**
//-----------------------------------------------------------------------
/**
* Queries this offset using the specified query.

@@ -402,3 +402,3 @@ *

/**
/**
* Adjusts the specified temporal object to have the same offset as this object.

@@ -405,0 +405,0 @@ *

@@ -33,3 +33,3 @@ /*

* not yet implemented
* @params {string} zoneId
* @param {string} zoneId
* @return {ZoneId}

@@ -42,3 +42,3 @@ */

//-------------------------------------------------------------------------
//-------------------------------------------------------------------------
/**

@@ -45,0 +45,0 @@ * Constructor.

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

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