Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue Number
Feature request issue: #960
Overview of PR
The current PR makes some small changes to variables of dayjs type to be of type number instead to allow flexibility when dealing with custom types.
Additions to
src/lib/default-config.tsandsrc/lib/types/main.tsto define the custom scale types and labels. This ideally would be injected by a user through the timeline props to create custom scales.Small changes in
src/lib/headers/...andsrc/lib/columns/Columns.tsxto have separation between the original calendar types and custom timescale types, and dayjs adjustments.Small changes in
src/lib/Timeline.tsxwith regards to dayjs.Main changes are in
src/lib/utility/calendar.tsxto process and use a custom timescale.There are additions in the demo files (
demod/src/demo-custom/...) for illustration purposes of the workings of a custom timescale.The changes are by no means complete, there would still be things to refactor and improve, while additionally being able to inject these custom types through the timeline props and not only just statically define them as in the current PR. Since such a feature could be achieved without many changes as shown in this PR, the hope is that the authors and maintainers of the original library would allow the inclusion of such a feature and then we can develop it to be ready to be part of the official release.