I'm trying to get moment to work without 0 padding or with 0 padding.
Working example:
const dbd = '01';
const dbm = '19';
const dby = '89';
const m = moment(`${dbd}${dbm}${dby}`, 'DD MM YY');
The above works great. But if I pass dbd = '1' then it says invalid. Users in my input field could enter the 0 or not. Is there a way to handle this in moment ?
I tried using
const m = moment(`${dbd}${dbm}${dby}`, 'D M YY');
But that didn't work either.