How to use the @js-joda/extra.Interval.of function in @js-joda/extra

To help you get started, we’ve selected a few @js-joda/extra examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github js-joda / js-joda / packages / examples / examples / node / node-modules-01.js View on Github external
const {
    Interval,
} = require('@js-joda/extra');

const {
    Duration,
    Instant,
    LocalDateTime,
    ZonedDateTime,
    ZoneId,
} = require('@js-joda/core');

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('node-modules-01 done');
github js-joda / js-joda / packages / examples / examples / node / node-modules-02.js View on Github external
Duration,
    Instant,
    LocalDateTime,
    ZonedDateTime,
    ZoneId,
} = require('@js-joda/core');
require('@js-joda/timezone');

const {
    Interval,
} = require('@js-joda/extra');

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('node-modules-02 done');
github js-joda / js-joda / packages / examples / examples / node / es6-modules-01.js View on Github external
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');
github js-joda / js-joda / packages / examples / examples / webpack / webpack-index.js View on Github external
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');

@js-joda/extra

additional date-time classes that complement those in js-joda

BSD-3-Clause
Latest version published 5 months ago

Package Health Score

78 / 100
Full package analysis

Popular @js-joda/extra functions