How to use the luxon.Interval.before function in luxon

To help you get started, we’ve selected a few luxon 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 flow-typed / flow-typed / definitions / npm / luxon_v0.4.x / flow_v0.104.x- / test_luxon.js View on Github external
(Interval.after(DateTime.utc(), Duration.fromObject({ year: 1 })): Interval);
(Interval.after(DateTime.utc(), { year: 1 }): Interval);
(Interval.after(DateTime.utc(), 1231234): Interval);
(Interval.after(
  { year: 2017, month: 1 },
  Duration.fromObject({ year: 1 })
): Interval);
(Interval.after({ year: 2017, month: 1 }, { year: 1 }): Interval);
(Interval.after({ year: 2017, month: 1 }, 123123): Interval);
// $ExpectError
(Interval.after({ year: 2017, month: 1, foo: "bar" }, { year: 1 }): Interval);
// $ExpectError
(Interval.after({ year: 2017, month: 1 }, { year: 1, foo: "bar" }): Interval);

(Interval.before(DateTime.utc(), Duration.fromObject({ year: 1 })): Interval);
(Interval.before(DateTime.utc(), { year: 1 }): Interval);
(Interval.before(DateTime.utc(), 1231234): Interval);
(Interval.before(
  { year: 2017, month: 1 },
  Duration.fromObject({ year: 1 })
): Interval);
(Interval.before({ year: 2017, month: 1 }, { year: 1 }): Interval);
(Interval.before({ year: 2017, month: 1 }, 123123): Interval);
// $ExpectError
(Interval.before({ year: 2017, month: 1, foo: "bar" }, { year: 1 }): Interval);
// $ExpectError
(Interval.before({ year: 2017, month: 1 }, { year: 1, foo: "bar" }): Interval);

(Interval.fromDateTimes(DateTime.utc(), DateTime.utc()): Interval);
(Interval.fromDateTimes(DateTime.utc(), { year: 2017, month: 1 }): Interval);
(Interval.fromDateTimes({ year: 2016, month: 1 }, DateTime.utc()): Interval);
github flow-typed / flow-typed / definitions / npm / luxon_v0.2.x / flow_v0.104.x- / test_luxon.js View on Github external
(Interval.after(DateTime.utc(), Duration.fromObject({ year: 1 })): Interval);
(Interval.after(DateTime.utc(), { year: 1 }): Interval);
(Interval.after(DateTime.utc(), 1231234): Interval);
(Interval.after(
  { year: 2017, month: 1 },
  Duration.fromObject({ year: 1 })
): Interval);
(Interval.after({ year: 2017, month: 1 }, { year: 1 }): Interval);
(Interval.after({ year: 2017, month: 1 }, 123123): Interval);
// $ExpectError
(Interval.after({ year: 2017, month: 1, foo: "bar" }, { year: 1 }): Interval);
// $ExpectError
(Interval.after({ year: 2017, month: 1 }, { year: 1, foo: "bar" }): Interval);

(Interval.before(DateTime.utc(), Duration.fromObject({ year: 1 })): Interval);
(Interval.before(DateTime.utc(), { year: 1 }): Interval);
(Interval.before(DateTime.utc(), 1231234): Interval);
(Interval.before(
  { year: 2017, month: 1 },
  Duration.fromObject({ year: 1 })
): Interval);
(Interval.before({ year: 2017, month: 1 }, { year: 1 }): Interval);
(Interval.before({ year: 2017, month: 1 }, 123123): Interval);
// $ExpectError
(Interval.before({ year: 2017, month: 1, foo: "bar" }, { year: 1 }): Interval);
// $ExpectError
(Interval.before({ year: 2017, month: 1 }, { year: 1, foo: "bar" }): Interval);

(Interval.fromDateTimes(DateTime.utc(), DateTime.utc()): Interval);
(Interval.fromDateTimes(DateTime.utc(), { year: 2017, month: 1 }): Interval);
(Interval.fromDateTimes({ year: 2016, month: 1 }, DateTime.utc()): Interval);
github flow-typed / flow-typed / definitions / npm / luxon_v0.4.x / flow_v0.104.x- / test_luxon.js View on Github external
// $ExpectError
(Interval.after({ year: 2017, month: 1 }, { year: 1, foo: "bar" }): Interval);

(Interval.before(DateTime.utc(), Duration.fromObject({ year: 1 })): Interval);
(Interval.before(DateTime.utc(), { year: 1 }): Interval);
(Interval.before(DateTime.utc(), 1231234): Interval);
(Interval.before(
  { year: 2017, month: 1 },
  Duration.fromObject({ year: 1 })
): Interval);
(Interval.before({ year: 2017, month: 1 }, { year: 1 }): Interval);
(Interval.before({ year: 2017, month: 1 }, 123123): Interval);
// $ExpectError
(Interval.before({ year: 2017, month: 1, foo: "bar" }, { year: 1 }): Interval);
// $ExpectError
(Interval.before({ year: 2017, month: 1 }, { year: 1, foo: "bar" }): Interval);

(Interval.fromDateTimes(DateTime.utc(), DateTime.utc()): Interval);
(Interval.fromDateTimes(DateTime.utc(), { year: 2017, month: 1 }): Interval);
(Interval.fromDateTimes({ year: 2016, month: 1 }, DateTime.utc()): Interval);
(Interval.fromDateTimes(
  { year: 2016, month: 1 },
  { year: 2017, month: 1 }
): Interval);
(Interval.fromDateTimes(
  // $ExpectError
  { year: 2016, month: 1, foo: 'bar' },
  { year: 2017, month: 1 }
): Interval);
(Interval.fromDateTimes(
  { year: 2016, month: 1 },
  // $ExpectError
github flow-typed / flow-typed / definitions / npm / luxon_v1.x.x / flow_v0.104.x- / test_luxon.js View on Github external
(Interval.after({ year: 2017, month: 1 }, { year: 1 }): Interval);
(Interval.after({ year: 2017, month: 1 }, 123123): Interval);
// $ExpectError
(Interval.after({ year: 2017, month: 1, foo: "bar" }, { year: 1 }): Interval);
// $ExpectError
(Interval.after({ year: 2017, month: 1 }, { year: 1, foo: "bar" }): Interval);

(Interval.before(DateTime.utc(), Duration.fromObject({ year: 1 })): Interval);
(Interval.before(DateTime.utc(), { year: 1 }): Interval);
(Interval.before(DateTime.utc(), 1231234): Interval);
(Interval.before(
  { year: 2017, month: 1 },
  Duration.fromObject({ year: 1 })
): Interval);
(Interval.before({ year: 2017, month: 1 }, { year: 1 }): Interval);
(Interval.before({ year: 2017, month: 1 }, 123123): Interval);
// $ExpectError
(Interval.before({ year: 2017, month: 1, foo: "bar" }, { year: 1 }): Interval);
// $ExpectError
(Interval.before({ year: 2017, month: 1 }, { year: 1, foo: "bar" }): Interval);

(Interval.fromDateTimes(DateTime.utc(), DateTime.utc()): Interval);
(Interval.fromDateTimes(DateTime.utc(), { year: 2017, month: 1 }): Interval);
(Interval.fromDateTimes({ year: 2016, month: 1 }, DateTime.utc()): Interval);
(Interval.fromDateTimes(
  { year: 2016, month: 1 },
  { year: 2017, month: 1 }
): Interval);
(Interval.fromDateTimes(
  // $ExpectError
  { year: 2016, month: 1, foo: 'bar' },
  { year: 2017, month: 1 }
github flow-typed / flow-typed / definitions / npm / luxon_v1.x.x / flow_v0.104.x- / test_luxon.js View on Github external
(Interval.after(DateTime.utc(), 1231234): Interval);
(Interval.after(
  { year: 2017, month: 1 },
  Duration.fromObject({ year: 1 })
): Interval);
(Interval.after({ year: 2017, month: 1 }, { year: 1 }): Interval);
(Interval.after({ year: 2017, month: 1 }, 123123): Interval);
// $ExpectError
(Interval.after({ year: 2017, month: 1, foo: "bar" }, { year: 1 }): Interval);
// $ExpectError
(Interval.after({ year: 2017, month: 1 }, { year: 1, foo: "bar" }): Interval);

(Interval.before(DateTime.utc(), Duration.fromObject({ year: 1 })): Interval);
(Interval.before(DateTime.utc(), { year: 1 }): Interval);
(Interval.before(DateTime.utc(), 1231234): Interval);
(Interval.before(
  { year: 2017, month: 1 },
  Duration.fromObject({ year: 1 })
): Interval);
(Interval.before({ year: 2017, month: 1 }, { year: 1 }): Interval);
(Interval.before({ year: 2017, month: 1 }, 123123): Interval);
// $ExpectError
(Interval.before({ year: 2017, month: 1, foo: "bar" }, { year: 1 }): Interval);
// $ExpectError
(Interval.before({ year: 2017, month: 1 }, { year: 1, foo: "bar" }): Interval);

(Interval.fromDateTimes(DateTime.utc(), DateTime.utc()): Interval);
(Interval.fromDateTimes(DateTime.utc(), { year: 2017, month: 1 }): Interval);
(Interval.fromDateTimes({ year: 2016, month: 1 }, DateTime.utc()): Interval);
(Interval.fromDateTimes(
  { year: 2016, month: 1 },
  { year: 2017, month: 1 }
github flow-typed / flow-typed / definitions / npm / luxon_v0.4.x / flow_v0.104.x- / test_luxon.js View on Github external
(Interval.after(DateTime.utc(), { year: 1 }): Interval);
(Interval.after(DateTime.utc(), 1231234): Interval);
(Interval.after(
  { year: 2017, month: 1 },
  Duration.fromObject({ year: 1 })
): Interval);
(Interval.after({ year: 2017, month: 1 }, { year: 1 }): Interval);
(Interval.after({ year: 2017, month: 1 }, 123123): Interval);
// $ExpectError
(Interval.after({ year: 2017, month: 1, foo: "bar" }, { year: 1 }): Interval);
// $ExpectError
(Interval.after({ year: 2017, month: 1 }, { year: 1, foo: "bar" }): Interval);

(Interval.before(DateTime.utc(), Duration.fromObject({ year: 1 })): Interval);
(Interval.before(DateTime.utc(), { year: 1 }): Interval);
(Interval.before(DateTime.utc(), 1231234): Interval);
(Interval.before(
  { year: 2017, month: 1 },
  Duration.fromObject({ year: 1 })
): Interval);
(Interval.before({ year: 2017, month: 1 }, { year: 1 }): Interval);
(Interval.before({ year: 2017, month: 1 }, 123123): Interval);
// $ExpectError
(Interval.before({ year: 2017, month: 1, foo: "bar" }, { year: 1 }): Interval);
// $ExpectError
(Interval.before({ year: 2017, month: 1 }, { year: 1, foo: "bar" }): Interval);

(Interval.fromDateTimes(DateTime.utc(), DateTime.utc()): Interval);
(Interval.fromDateTimes(DateTime.utc(), { year: 2017, month: 1 }): Interval);
(Interval.fromDateTimes({ year: 2016, month: 1 }, DateTime.utc()): Interval);
(Interval.fromDateTimes(
  { year: 2016, month: 1 },
github flow-typed / flow-typed / definitions / npm / luxon_v0.4.x / flow_v0.104.x- / test_luxon.js View on Github external
(Interval.after(DateTime.utc(), Duration.fromObject({ year: 1 })): Interval);
(Interval.after(DateTime.utc(), { year: 1 }): Interval);
(Interval.after(DateTime.utc(), 1231234): Interval);
(Interval.after(
  { year: 2017, month: 1 },
  Duration.fromObject({ year: 1 })
): Interval);
(Interval.after({ year: 2017, month: 1 }, { year: 1 }): Interval);
(Interval.after({ year: 2017, month: 1 }, 123123): Interval);
// $ExpectError
(Interval.after({ year: 2017, month: 1, foo: "bar" }, { year: 1 }): Interval);
// $ExpectError
(Interval.after({ year: 2017, month: 1 }, { year: 1, foo: "bar" }): Interval);

(Interval.before(DateTime.utc(), Duration.fromObject({ year: 1 })): Interval);
(Interval.before(DateTime.utc(), { year: 1 }): Interval);
(Interval.before(DateTime.utc(), 1231234): Interval);
(Interval.before(
  { year: 2017, month: 1 },
  Duration.fromObject({ year: 1 })
): Interval);
(Interval.before({ year: 2017, month: 1 }, { year: 1 }): Interval);
(Interval.before({ year: 2017, month: 1 }, 123123): Interval);
// $ExpectError
(Interval.before({ year: 2017, month: 1, foo: "bar" }, { year: 1 }): Interval);
// $ExpectError
(Interval.before({ year: 2017, month: 1 }, { year: 1, foo: "bar" }): Interval);

(Interval.fromDateTimes(DateTime.utc(), DateTime.utc()): Interval);
(Interval.fromDateTimes(DateTime.utc(), { year: 2017, month: 1 }): Interval);
(Interval.fromDateTimes({ year: 2016, month: 1 }, DateTime.utc()): Interval);
(Interval.fromDateTimes(
github flow-typed / flow-typed / definitions / npm / luxon_v0.2.x / flow_v0.104.x- / test_luxon.js View on Github external
// $ExpectError
(Interval.after({ year: 2017, month: 1 }, { year: 1, foo: "bar" }): Interval);

(Interval.before(DateTime.utc(), Duration.fromObject({ year: 1 })): Interval);
(Interval.before(DateTime.utc(), { year: 1 }): Interval);
(Interval.before(DateTime.utc(), 1231234): Interval);
(Interval.before(
  { year: 2017, month: 1 },
  Duration.fromObject({ year: 1 })
): Interval);
(Interval.before({ year: 2017, month: 1 }, { year: 1 }): Interval);
(Interval.before({ year: 2017, month: 1 }, 123123): Interval);
// $ExpectError
(Interval.before({ year: 2017, month: 1, foo: "bar" }, { year: 1 }): Interval);
// $ExpectError
(Interval.before({ year: 2017, month: 1 }, { year: 1, foo: "bar" }): Interval);

(Interval.fromDateTimes(DateTime.utc(), DateTime.utc()): Interval);
(Interval.fromDateTimes(DateTime.utc(), { year: 2017, month: 1 }): Interval);
(Interval.fromDateTimes({ year: 2016, month: 1 }, DateTime.utc()): Interval);
(Interval.fromDateTimes(
  { year: 2016, month: 1 },
  { year: 2017, month: 1 }
): Interval);
(Interval.fromDateTimes(
  // $ExpectError
  { year: 2016, month: 1, foo: 'bar' },
  { year: 2017, month: 1 }
): Interval);
(Interval.fromDateTimes(
  { year: 2016, month: 1 },
  // $ExpectError
github flow-typed / flow-typed / definitions / npm / luxon_v0.2.x / flow_v0.104.x- / test_luxon.js View on Github external
(Interval.after(DateTime.utc(), Duration.fromObject({ year: 1 })): Interval);
(Interval.after(DateTime.utc(), { year: 1 }): Interval);
(Interval.after(DateTime.utc(), 1231234): Interval);
(Interval.after(
  { year: 2017, month: 1 },
  Duration.fromObject({ year: 1 })
): Interval);
(Interval.after({ year: 2017, month: 1 }, { year: 1 }): Interval);
(Interval.after({ year: 2017, month: 1 }, 123123): Interval);
// $ExpectError
(Interval.after({ year: 2017, month: 1, foo: "bar" }, { year: 1 }): Interval);
// $ExpectError
(Interval.after({ year: 2017, month: 1 }, { year: 1, foo: "bar" }): Interval);

(Interval.before(DateTime.utc(), Duration.fromObject({ year: 1 })): Interval);
(Interval.before(DateTime.utc(), { year: 1 }): Interval);
(Interval.before(DateTime.utc(), 1231234): Interval);
(Interval.before(
  { year: 2017, month: 1 },
  Duration.fromObject({ year: 1 })
): Interval);
(Interval.before({ year: 2017, month: 1 }, { year: 1 }): Interval);
(Interval.before({ year: 2017, month: 1 }, 123123): Interval);
// $ExpectError
(Interval.before({ year: 2017, month: 1, foo: "bar" }, { year: 1 }): Interval);
// $ExpectError
(Interval.before({ year: 2017, month: 1 }, { year: 1, foo: "bar" }): Interval);

(Interval.fromDateTimes(DateTime.utc(), DateTime.utc()): Interval);
(Interval.fromDateTimes(DateTime.utc(), { year: 2017, month: 1 }): Interval);
(Interval.fromDateTimes({ year: 2016, month: 1 }, DateTime.utc()): Interval);
(Interval.fromDateTimes(
github moment / luxon / test / interval / create.js View on Github external
it('Interval.before takes a number and unit', () => {
    let end = Instant.fromObject({year: 2016, month: 5, day: 25}),
        int = Interval.before(end, 3, 'days');

    expect(int.start().day()).toBe(22);
    expect(int.end()).toBe(end);
  });
};