@naturalcycles/time-lib
Advanced tools
Comparing version 3.5.0 to 3.5.1
@@ -1,2 +0,2 @@ | ||
import { END, Seq } from '@naturalcycles/js-lib'; | ||
import { END, Sequence } from '@naturalcycles/js-lib'; | ||
import { dayjs } from './index'; | ||
@@ -21,3 +21,3 @@ /** | ||
const max = dayjs(maxExcl).startOf(stepUnit); | ||
return Seq.create(min, d => { | ||
return Sequence.create(min, d => { | ||
const next = d.add(step, stepUnit); | ||
@@ -24,0 +24,0 @@ return next.isAfter(max) ? END : next; |
@@ -1,2 +0,2 @@ | ||
import { IsoDate, Seq } from '@naturalcycles/js-lib'; | ||
import { IsoDate, Sequence } from '@naturalcycles/js-lib'; | ||
import { ConfigType, IDayjs, OpUnitType } from './index'; | ||
@@ -9,3 +9,3 @@ /** | ||
export declare function dayjsRange(minIncl: ConfigType, maxExcl: ConfigType, step?: number, stepUnit?: OpUnitType): IDayjs[]; | ||
export declare function dayjsRangeSeq(minIncl: ConfigType, maxExcl: ConfigType, step?: number, stepUnit?: OpUnitType): Seq<IDayjs>; | ||
export declare function dayjsRangeSeq(minIncl: ConfigType, maxExcl: ConfigType, step?: number, stepUnit?: OpUnitType): Sequence<IDayjs>; | ||
export declare function dayjsRangeISODate(minIncl: ConfigType, maxExcl: ConfigType, step?: number, stepUnit?: OpUnitType): IsoDate[]; | ||
@@ -12,0 +12,0 @@ /** |
@@ -25,3 +25,3 @@ "use strict"; | ||
const max = (0, index_1.dayjs)(maxExcl).startOf(stepUnit); | ||
return js_lib_1.Seq.create(min, d => { | ||
return js_lib_1.Sequence.create(min, d => { | ||
const next = d.add(step, stepUnit); | ||
@@ -28,0 +28,0 @@ return next.isAfter(max) ? js_lib_1.END : next; |
@@ -43,3 +43,3 @@ { | ||
}, | ||
"version": "3.5.0", | ||
"version": "3.5.1", | ||
"description": "Date/time related API, based on Day.js", | ||
@@ -46,0 +46,0 @@ "keywords": [ |
@@ -1,2 +0,2 @@ | ||
import { END, IsoDate, Seq } from '@naturalcycles/js-lib' | ||
import { END, IsoDate, Sequence } from '@naturalcycles/js-lib' | ||
import { ConfigType, dayjs, IDayjs, OpUnitType } from './index' | ||
@@ -32,6 +32,6 @@ | ||
stepUnit: OpUnitType = 'd', | ||
): Seq<IDayjs> { | ||
): Sequence<IDayjs> { | ||
const min = dayjs(minIncl).startOf(stepUnit) | ||
const max = dayjs(maxExcl).startOf(stepUnit) | ||
return Seq.create(min, d => { | ||
return Sequence.create(min, d => { | ||
const next = d.add(step, stepUnit) | ||
@@ -38,0 +38,0 @@ return next.isAfter(max) ? END : next |
54901