Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(hover): add formattimecallback option #3628

Merged

Conversation

Adrii77
Copy link
Contributor

@Adrii77 Adrii77 commented Apr 3, 2024

Short description

Add formatTimeCallback option for Hover plugin

Implementation details

Reuse previous formatTime method as a new option named formatTimeCallback.

How to test it

  • yarn start
  • Go to Hover plugin's page on the app
  • Hover the waveform to see plugin's working
  • In Hover.create object in params, add
formatTimeCallback(time) {
            const hours = Math.floor(time / 3600);
            const minutes = Math.floor((time % 3600) / 60);
            const seconds = Math.floor(time % 60);

            const formattedTime = [hours, minutes, seconds]
              .map(value => (value < 10 ? `0${value}` : value))
              .join(':');

            return formattedTime;
          },
  • Hover the waveform to see time label as "hh:mm:ss"

Checklist

  • This PR is covered by e2e tests
  • It introduces no breaking API changes
Copy link
Owner

@katspaugh katspaugh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect, thank you! 🙏

@katspaugh katspaugh merged commit 1f79dc0 into katspaugh:main Apr 3, 2024
1 of 2 checks passed
@Adrii77 Adrii77 deleted the feat/hover-formattimecallback-option branch April 4, 2024 06:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants