This repo attempts to follow semantic versioning.
- None
@rschedule/core
Adds ametadata
property toDateAdapterBase
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
AddVEvent.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 luxonv1.x
andv2.x
. If you want to use rSchedule with luxon v2, you can do so with the newv2
entrypoint in the@rschedule/luxon-date-adapter
package.- e.g.
import "@rschedule/luxon-date-adapter/v2/setup"
- e.g.
- Ensure
VEvent#set('start', )
also updates rrules/exrules (issue #56).
- Standardize toISOString() implementation. Previously, different date adapters (apparently) were returning slightly different formatting (e.g.
joda-date-adapter
) (!62). - Fix
DatejsDateAdapter#set('timezone', value)
. Previously, attempting to set a new timezone value for aDayjsDateAdapter
was ignored (!62).
- Do not throw error when reregistering a JSON serializer (issue #53)
- Explicitly define the return type of functions and methods (issue #47)
- Update typescript to version 3.9.x
- Check presence of dayjs "UTC" plugin at run time rather than at import time (#44).
- Add
DayjsDateAdapter
package (#43).
- Fixed the handling of the
skipToDate
OccurrenceIteratornext()
arg (!54)
- Fixed an issue when using IntersectionOperator with a RecurrencePipe (!53)
- Properly serialize a VEvent containing a rule with an interval (#39)
- Remove
byMillisecondOfSecond
from VEvent rule options.
- Same as
1.0.1
but fixes a build issue with that version.
- Added all side effects declarations to each module's main
package.json
file as an attempted fix for issue #37. Previously each entry point handled it's own side effects declarations.
- This marks the first non-beta release of rSchedule. There is no functional difference between this version and version
0.12.2
.
- Clarify the effect of the
timezone
argument in the docs. - Fixed bug that could occur if a
RecurrenceRulesIterator
was passed run options with astart
/end
time in a different time zone from theRecurrenceRulesIterator's
rule start time (#35). - Fixed a bug that could result in generated date adapters not having the proper
generators
value.
- Fixed module build targets so that
UMD
targetses5
andes2015
targetses2015
(#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.- Similarly,
@rschedule/core/generators
contains the opinionatedOccurrenceGenerator
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
.- DateAdapter updated to support different date libraries via typescript declaration merging. This affects almost all of the types in the library, most of which are no longer generic.
OccurrenceGenerator
is no longer generic. Similarly,Calendar
,Schedule
,Rule
, andDates
only receive an optional generic param for theirdata
attribute.IDateAdapter
removed and folded into theDateAdapterBase
class. Now, all date adapters must extend the abstractDateAdapterBase
class.DateAdapter
class renamedDateAdapterBase
.DateAdapter
is now an exported type equal to the activated date adapter, as well as a namespace.- It is now impossible to utilize two different date adapters in a single project at the same time. This was never encouraged, but previously it was possible.
Dates
duration
constructor argument now only applies the duration to provided dates which do not already have a duration. Put another way, theduration
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 fromnumber | undefined
tonumber
. A duration of0
is treated as no duration.OccurrenceGenerator#collections()
arguments changed. Specifically, CollectionIteratorICollectionArgs
interface changed.incrementLinearly
option removedskipEmptyPeriods
option addedgranularity
"INSTANTANIOUS"
option removed. Use"MILLISECONDLY"
instead (which does the same thing).- By default,
OccurrenceGenerator#collections()
now increments linearly. You can useskipEmptyPeriods: true
to get the old default behavior.
- Default granularity for
OccurrenceGenerator#collections()
is now"YEARLY"
. This change was made to accomidate the other changes to CollectionIterator. @rschedule/json-tools
no longer exportsparseJSON()
orserializeToJSON()
functions. Instead, the library contains individual modules for each rSchedule object which, when imported, modify that rschedule object, addingtoJSON()
and staticfromJSON()
methods.@rschedule/ical-tools
no longer exportsparseICal()
orserializeToICal()
functions. Instead,VEvent
now hasVEvent#toICal()
andVEvent.fromICal()
.
- Added
DateAdapter#set('duration', number)
option for setting a date adapters duration. RecurrenceRuleIterator
, as well as individual recurrence rules, are now public API.
- Fixed potential bug when calling
OccurrenceGenerator#collections()
with granularity"MONTHLY"
and aweekStart
value. - Fixed the return type of
OccurrenceGenerator#[Symbol.iterator]
OccurrenceGenerator#firstDate
andOccurrenceGenerator#lastDate
now cache their value after the initial lazy evaluation.- Combine time-related rule pipe logic into a base class to reduce bundle size
- Rigorously assert that rule options are valid. Previously, the library assumed typescript would catch obvious type errors and wouldn't bother checking for them.
- Add JodaDateAdapter
- Prevent VEvent objects from being initialized with a rule specifying a
MILLISECONDLY
frequency.
- upgraded
OccurrenceGenerator
methods to be duration awareoccursBetween
occursOn
occursAfter
occursBefore
- add option to
Calendar#set()
to setCalendar#schedules
- added ability to set rule frequency to 'MILLISECONDLY'
- added unit tests for
PipeController
and fixed bugs discovered during this process- fixed bug that affected reverse iteration of rules with a
count
property - fixed bug that affected reverse iteration with an interval > 1
- fixed
DateTime#set()
bug that could occur when setting months
- fixed bug that affected reverse iteration of rules with a
- added individual tests for each rule pipe
- fixed a few bugs in the
RevByDayOfWeek
pipe
- fixed iterating
Dates
in reverse with either thestart
/end
arg - fixed
OccurrenceGenerator#occursBefore()
- fixed iterating occurrence operators in reverse
- added tests to help ensure a similar issue doesn't happen in the future.
- added
SplitDurationOperator
. - added
VEvent#duration
support ical-tools
can parse/serialize VEVENTs withduration
/dtend
property.Dates#set()
can be used to set all theduration
values of the underlying dates.
- fixed
MergeDurationOperator#_run()
not returning all relevant occurrences when provided astart
orend
arg. - make the ordering of all ordered date arrays
duration
aware (for resolving order of otherwise identical dates).
- added
MergeDurationOperator
.
- fixed bug in the calculation of
Operator#isInfinite
. - fixed bug in
AddOperator#_run()
andIntersectionOperator#_run()
when iterating withreverse: true
and astart
/end
time.
- updated
RScheduleConfig
so that config options are namespaced. - updated
@rschedule/json-tools
- So that
IntersectionOperator#maxFailedIterations
is serialized.- There is no longer the option to provide
maxFailedIterations
toparseJSON()
.
- There is no longer the option to provide
- The
serializeToJSON()
interface has changed - The
parseJSON()
interface has changed to improve typing
- So that
- replace
ConstructorReturnType
with typescript builtinInstanceType
- reversed the order of the
DateAdapter#generators
property. - changed the default type of
DateAdapter#generators
tounknown[]
- fixed type inference in some
@rschedule/rule-tools
methods which involved changing the type arguments.
- added
@rschedule/rule-tools
package. - ability to set all
Rule#options
viaRule#set()
. - added
IScheduleLike<T extends typeof DateAdapter>
interface. - added
IDataContainer<D>
interface - added
RScheduleConfig.Rule.defaultWeekStart
config option. - added
Operator.isOperator()
- added support for serializing / parsing the
data
property to@rschedule/json-tools
. - when iterating through a
Schedule
,Calendar
,VEvent
,Dates
, orRule
object, thegenerators
property now receives some proper typing. This will make accessing thedata
property on occurrence generators easier. - improved typing of many
isInstance
methods. - added
DateAdapterFor<O extends IOccurrenceGenerator>
- added
DataFor<O extends IDataContainer>
- added
DateAdapter#end
- ability to keep local time when calling
IOccurrenceGenerator#set('timezone')
AddOperator.isAddOperator()
SubtractOperator.isSubtractOperator()
IntersectionOperator.isIntersectionOperator()
UniqueOperator.isUniqueOperator()
OccurrenceStream.isOccurrenceStream()
- ensure
DateAdapter#date
is immutable - don't include
undefined
properties inDateAdapter#toJSON()
- ensure
DateAdapter#generators
is propogated to results
- fixed
VEvent
to allow multiple rrules / exrules as per the ical spec.- This also included appropriate changes in
ical-tools
serializeToICal()
andparseICal()
functions.
- This also included appropriate changes in
- updated
Dates
to not change the timezone associated withDates#adapters
. This means that a date inDates#adapters
may not have the same timezone asDates#timezone
(dates yielded byDates
are still updated to have the same timezone asDates#timezone
, however). This distinction can be important when serializing aDates
object as it ensures the original timezones associated with the underlying dates are preserved.
- added ability to set individual
Rule#options
viaRule#set()
. - added ability to pass whole
Rule
andDates
objects to theVEvent
constructor. - added
VEvent#set()
,VEvent#add()
, andVEvent#remove()
.
- Fixed npm tag associated with
@rschedule/rschedule
release
- Rewrote repo so that, internally, immutable custom
DateTime
objects are used for datetime manipulation. This appears to have eliminated all outstanding recurrence bugs. - Moved
MomentTZDateAdapter
into its own package. - Updated
json-tools
to work with new API. - Updated
ical-tools
to work with new API.- Added new
VEvent
object which aligns to theVEVENT
component in the ICalendar spec. - Removed the
ical-tools
dependency onlodash.clonedeep
.
- Added new
- Eliminated
EXRule
,RRule
,EXDate
, andRDate
objects. Now there are justDates
andRule
objects. - Simplified the code for operators.
- Simplified the code for DateAdapters.
- Renamed
until
rule option toend
. - Changed rSchedule's representation of the "local" timezone from
undefined
tonull
.
- Added in beginning of
duration
support. - Migrated docs from a gitlab WIKI to individual files inside the repo so that doc changes are tracked alongside the repo.
- Added immutable
add()
,remove()
, andset()
CRUD methods toSchedule
andDates
. - Added immutable
filter()
method toDates
which filters theDates
object's associated dates and returns a newDates
object.