@rschedule/joda-date-adapter
An rSchedule DateAdapter for "js-joda" ZonedDateTime objects. Intended to be used with the @rschedule/core
package.
An rSchedule DateAdapter for "js-joda" ZonedDateTime objects.
An rSchedule DateAdapter for "js-joda" ZonedDateTime objects. Intended to be used with the @rschedule/core
package.
This repo attempts to follow semantic versioning.
@rschedule/core
Adds a metadata
property to DateAdapterBase
that can be used to store metadata related to a specific date adapter. Currently this property is just used by the ical-tools package to remember if a given DateAdapter should be serialized as a "date" or "date-time" value. Package consumers can also use this property to store data if they wish.@rschedule/ical-tools
fixes a bug which prevented the proper parsing and serializing of ical "date" values (e.g. "DTSTART;VALUE=DATE:20210909"
).@rschedule/ical-tools
Add VEvent.fromJCal()
static method. See #70 for additional information. I don't expect many people to benefit from this.@rschedule/luxon-date-adapter
fix typo in @rschedule/luxon-date-adapter/v1/setup
and @rschedule/luxon-date-adapter/v2/setup
package.json files@rschedule/luxon-date-adapter
support both luxon v1.x
and v2.x
. If you want to use rSchedule with luxon v2, you can do so with the new v2
entrypoint in the @rschedule/luxon-date-adapter
package.import "@rschedule/luxon-date-adapter/v2/setup"
VEvent#set('start', )
also updates rrules/exrules (issue #56).joda-date-adapter
) (!62).DatejsDateAdapter#set('timezone', value)
. Previously, attempting to set a new timezone value for a DayjsDateAdapter
was ignored (!62).DayjsDateAdapter
package (#43).skipToDate
OccurrenceIterator next()
arg (!54)byMillisecondOfSecond
from VEvent rule options.1.0.1
but fixes a build issue with that version.package.json
file as an attempted fix for issue #37. Previously each entry point handled it's own side effects declarations.0.12.2
.timezone
argument in the docs.RecurrenceRulesIterator
was passed run options with a start
/end
time in a different time zone from the RecurrenceRulesIterator's
rule start time (#35).generators
value.UMD
targets es5
and es2015
targets es2015
(#34)This is a large breaking change to the library that simplifies the API and increases the modularity / extensibility of the code. You should check out the updated docs to understand all of the changes. The new API is similar to the old API, but better.
Through some dark, typescript sorcery, rSchedule no longer needs to export generic objects to adapt the library's typing for different date adapters. Now you can simply import your date adapter of choice once, and the types of rSchedule's objects will automatically be updated. Where before you might have:
const rule = new Rule<typeof MomentDateAdapter>();
const dates: Moment[] = rule
.occurrences()
.toArray()
.map(({ date }) => date);
// OR
const rule = new Rule<typeof StandardDateAdapter>();
const dates: Date[] = rule
.occurrences()
.toArray()
.map(({ date }) => date);
now you simply have
const rule = new Rule();
const dates: Moment[] = rule
.occurrences()
.toArray()
.map(({ date }) => date);
// OR, when using the StandardDateAdapter
const rule = new Rule();
const dates: Date[] = rule
.occurrences()
.toArray()
.map(({ date }) => date);
it's magical! End users need never touch a date adapter.
The @rschedule/rschedule
package has been removed and replaced with @rschedule/core
which itself has been broken up into @rschedule/core
, @rschedule/core/generators
, and @rschedule/core/rules
. The recurrence rule API has also been improved, simplified, and now made public (where before it was private API).
@rschedule/core
contains the required bits of the library: the recurrence and date adapter logic and nothing else (it doesn't contain any actual recurrence rules).@rschedule/core/rules
contains individual rule modules. You can now pick and choose which rules you care about, potentially reducing bundle size. Unused rules are tree-shakable. This also means that this library can add additional rules in the future, without worrying about bloating the library for folks that don't need the new features.@rschedule/core/generators
contains the opinionated OccurrenceGenerator
API, which is also now optional and tree-shakable. This allows additional occurrence stream operators to be added in the future, without fear of bloating the library for folks who don't need them.Note: this update is large and not all changes are included below.
@rschedule/rschedule
-> @rschedule/core
, @rschedule/core/generators
, and @rschedule/core/rules
.OccurrenceGenerator
is no longer generic. Similarly, Calendar
, Schedule
, Rule
, and Dates
only receive an optional generic param for their data
attribute.IDateAdapter
removed and folded into the DateAdapterBase
class. Now, all date adapters must extend the abstract DateAdapterBase
class.DateAdapter
class renamed DateAdapterBase
. DateAdapter
is now an exported type equal to the activated date adapter, as well as a namespace.Dates
duration
constructor argument now only applies the duration to provided dates which do not already have a duration. Put another way, the duration
option for the dates constructor now acts as a default duration for provided dates, rather than the duration of all dates.DateAdapter#duration
type changed from number | undefined
to number
. A duration of 0
is treated as no duration.OccurrenceGenerator#collections()
arguments changed. Specifically, CollectionIterator ICollectionArgs
interface changed.incrementLinearly
option removedskipEmptyPeriods
option addedgranularity
"INSTANTANIOUS"
option removed. Use "MILLISECONDLY"
instead (which does the same thing).OccurrenceGenerator#collections()
now increments linearly. You can use skipEmptyPeriods: true
to get the old default behavior.OccurrenceGenerator#collections()
is now "YEARLY"
. This change was made to accomidate the other changes to CollectionIterator.@rschedule/json-tools
no longer exports parseJSON()
or serializeToJSON()
functions. Instead, the library contains individual modules for each rSchedule object which, when imported, modify that rschedule object, adding toJSON()
and static fromJSON()
methods.@rschedule/ical-tools
no longer exports parseICal()
or serializeToICal()
functions. Instead, VEvent
now has VEvent#toICal()
and VEvent.fromICal()
.DateAdapter#set('duration', number)
option for setting a date adapters duration.RecurrenceRuleIterator
, as well as individual recurrence rules, are now public API.OccurrenceGenerator#collections()
with granularity "MONTHLY"
and a weekStart
value.OccurrenceGenerator#[Symbol.iterator]
OccurrenceGenerator#firstDate
and OccurrenceGenerator#lastDate
now cache their value after the initial lazy evaluation.MILLISECONDLY
frequency.OccurrenceGenerator
methods to be duration awareoccursBetween
occursOn
occursAfter
occursBefore
Calendar#set()
to set Calendar#schedules
PipeController
and fixed bugs discovered during this processcount
propertyDateTime#set()
bug that could occur when setting monthsRevByDayOfWeek
pipeDates
in reverse with either the start
/end
argOccurrenceGenerator#occursBefore()
SplitDurationOperator
.VEvent#duration
supportical-tools
can parse/serialize VEVENTs with duration
/dtend
property.Dates#set()
can be used to set all the duration
values of the underlying dates.MergeDurationOperator#_run()
not returning all relevant occurrences when provided a start
or end
arg.duration
aware (for resolving order of otherwise identical dates).MergeDurationOperator
.Operator#isInfinite
.AddOperator#_run()
and IntersectionOperator#_run()
when iterating with reverse: true
and a start
/ end
time.RScheduleConfig
so that config options are namespaced.@rschedule/json-tools
IntersectionOperator#maxFailedIterations
is serialized.maxFailedIterations
to parseJSON()
.serializeToJSON()
interface has changedparseJSON()
interface has changed to improve typingConstructorReturnType
with typescript builtin InstanceType
DateAdapter#generators
property.DateAdapter#generators
to unknown[]
@rschedule/rule-tools
methods which involved changing the type arguments.@rschedule/rule-tools
package.Rule#options
via Rule#set()
.IScheduleLike<T extends typeof DateAdapter>
interface.IDataContainer<D>
interfaceRScheduleConfig.Rule.defaultWeekStart
config option.Operator.isOperator()
data
property to @rschedule/json-tools
.Schedule
, Calendar
, VEvent
, Dates
, or Rule
object, the generators
property now receives some proper typing. This will make accessing the data
property on occurrence generators easier.isInstance
methods.DateAdapterFor<O extends IOccurrenceGenerator>
DataFor<O extends IDataContainer>
DateAdapter#end
IOccurrenceGenerator#set('timezone')
AddOperator.isAddOperator()
SubtractOperator.isSubtractOperator()
IntersectionOperator.isIntersectionOperator()
UniqueOperator.isUniqueOperator()
OccurrenceStream.isOccurrenceStream()
DateAdapter#date
is immutableundefined
properties in DateAdapter#toJSON()
DateAdapter#generators
is propogated to resultsVEvent
to allow multiple rrules / exrules as per the ical spec.ical-tools
serializeToICal()
and
parseICal()
functions.Dates
to not change the timezone associated with Dates#adapters
.
This means that a date in Dates#adapters
may not have the same timezone as Dates#timezone
(dates yielded by Dates
are still updated to have the same timezone as Dates#timezone
, however).
This distinction can be important when serializing a Dates
object as it ensures the original
timezones associated with the underlying dates are preserved.Rule#options
via Rule#set()
.Rule
and Dates
objects to the VEvent
constructor.VEvent#set()
, VEvent#add()
, and VEvent#remove()
.@rschedule/rschedule
releaseDateTime
objects are used for datetime manipulation. This appears to have eliminated all outstanding recurrence bugs.MomentTZDateAdapter
into its own package.json-tools
to work with new API.ical-tools
to work with new API.VEvent
object which aligns to the VEVENT
component in the ICalendar spec.ical-tools
dependency on lodash.clonedeep
.EXRule
, RRule
, EXDate
, and RDate
objects. Now there are just Dates
and Rule
objects.until
rule option to end
.undefined
to null
.duration
support.add()
, remove()
, and set()
CRUD methods to Schedule
and Dates
.filter()
method to Dates
which filters the Dates
object's associated dates and returns a new Dates
object.