Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
/* eslint-disable no-console */
const {
ChronoUnit,
LocalDate,
LocalDateTime,
ZonedDateTime,
} = require('@js-joda/core');
console.log(LocalDateTime.now().toString());
console.log(ZonedDateTime.now().toString());
console.log(LocalDate.now().until(LocalDate.now().plusDays(10), ChronoUnit.DAYS));
console.log('node-modules-03 done');
import {
ChronoUnit,
Duration,
Instant,
LocalDate,
LocalDateTime,
ZonedDateTime,
ZoneId,
} from '@js-joda/core';
import {
Interval,
} from '@js-joda/extra';
import '@js-joda/timezone';
console.log(LocalDate.now().until(LocalDate.now().plusDays(10), ChronoUnit.DAYS));
console.log(LocalDateTime.now().toString());
console.log(ZonedDateTime.now().toString());
console.log(ZonedDateTime.now(ZoneId.of('America/New_York')).toString());
console.log(Interval.of(Instant.now(), Duration.ofMinutes(1)).toString());
console.log('webpack-index done');
import {
ChronoUnit,
Duration,
Instant,
LocalDate,
LocalDateTime,
ZonedDateTime,
ZoneId,
} from '@js-joda/core';
import {
Interval,
} from '@js-joda/extra';
import '@js-joda/timezone';
console.log(LocalDate.now().until(LocalDate.now().plusDays(10), ChronoUnit.DAYS));
console.log(LocalDateTime.now().toString());
console.log(ZonedDateTime.now().toString());
console.log(ZonedDateTime.now(ZoneId.of('America/New_York')).toString());
console.log(Interval.of(Instant.now(), Duration.ofMinutes(1)).toString());
console.log('es6-modules-01 done');
let days;
if (resolverStyle === ResolverStyle.LENIENT) {
date = LocalDate.of(wby, 1, this._weekDef.minimalDaysInFirstWeek()); //TODO: chrono.date(wby, 1, this._weekDef.minimalDaysInFirstWeek());
const wowby = fieldValues.get(this._weekDef.weekOfWeekBasedYear());
const dateDow = this._localizedDayOfWeek(date, sow);
const weeks = wowby - this._localizedWeekOfYear(date, dateDow);
days = weeks * 7 + (dow - dateDow);
} else {
date = LocalDate.of(wby, 1, this._weekDef.minimalDaysInFirstWeek()); //TODO: chrono.date(wby, 1, this._weekDef.minimalDaysInFirstWeek());
const wowby = this._weekDef.weekOfWeekBasedYear().range().checkValidIntValue(
fieldValues.get(this._weekDef.weekOfWeekBasedYear()), this._weekDef.weekOfWeekBasedYear);
const dateDow = this._localizedDayOfWeek(date, sow);
const weeks = wowby - this._localizedWeekOfYear(date, dateDow);
days = weeks * 7 + (dow - dateDow);
}
date = date.plus(days, ChronoUnit.DAYS);
if (resolverStyle === ResolverStyle.STRICT) {
if (date.getLong(this) !== fieldValues.get(this)) {
throw new DateTimeException('Strict mode rejected date parsed to a different year');
}
}
fieldValues.remove(this);
fieldValues.remove(this._weekDef.weekOfWeekBasedYear());
fieldValues.remove(ChronoField.DAY_OF_WEEK);
return date;
}
if (fieldValues.containsKey(ChronoField.YEAR) === false) {
return null;
}
const isoDow = ChronoField.DAY_OF_WEEK.checkValidIntValue(fieldValues.get(ChronoField.DAY_OF_WEEK));
const dow = MathUtil.floorMod(isoDow - sow, 7) + 1;