I have a date string that is created by adding the following pieces:
var dateString = d + "/" + m + "/" + y;
The other variables are created previously in my code as being fetched from an internal web page (d = day, m = month, y = year). This works fine so far.
How can I achieve that a leading zero is added to them if d and/or m consist of only digit ? E.g. if d = 1 then it should become 01 and the same for m.
Many thanks in advance for any help with this, Tim.