Convert Date

Convert Date

This function should take a date string in the format dd/mm/yyyy and convert it to the format yyyy-mm-dd. If the input is not in the correct format, the function should return an error message "Error: Invalid date.".

example

Input: String (string).

Output: String (string).

Examples:

assert.strictEqual(convertDate("25/12/2021"), "2021-12-25");
assert.strictEqual(convertDate("01/01/2000"),...
You should be an authorized user in order to see the full description and start solving this mission.