Skip to content

Conversation

@minsgy
Copy link

@minsgy minsgy commented Mar 29, 2024

Hello, I am a user who has been finding vis-timeline very useful. I have encountered some inconveniences while using it and have decided to submit a PR.

  • I would like to request a PR to modify the type of TimelineFormatLabelsFunction defined in TimelineOptions > format > minorLabels, majorLabels.
  • The first date argument returned is not a Date object but a Moment object. I hope to fully utilize it by inferring the type as Moment.
  • If not, it seems necessary to change the TimelineFormatLabelsFunction so that the first argument is returned as a Date. However, doing so seems like it would increase the workload, so I have opted for a simpler approach.
    Relevant images and code

Relevant images and code

// use-case
    minorLabels: (date: Date, scale: string, step: number) => {
      console.log(date)
      return ""
    },

Displayed code
image

�fix

  • Change the first params type of the defined TimelineFormatLabelsFunction object to Moment.

@minsgy minsgy changed the title fix: timeline format labels funtion Date params to Moment type fix Timeline format labels funtion Date params to Moment type fix Mar 29, 2024
@minsgy minsgy force-pushed the master branch 2 times, most recently from 5cf1e43 to 81cbb8c Compare April 14, 2024 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant