Reminds me of something I started building for a client for a similar purpose, but as we had limited needs, I never fleshed it out as much.
Am curious why you used the if/else for adding the leading 0s, and not:
Only IE doesn't support padStart...
No particular reason. padStart works well for this.
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.