Skip to content
Snippets Groups Projects
Verified Commit 63e5d7c1 authored by Defendi Alberto's avatar Defendi Alberto
Browse files

Util for formatting dates.

parent 3c38c464
No related branches found
No related tags found
2 merge requests!69Possibility to insert a reservation and new docs.,!68Implement list by date.
/**
* Util to format a date complying to server format.
* @param date date to format.
* @returns date formatted in format YYYY-MM-DD.
*/
export const formatDate = (date: Date): string =>
date !== null && date !== undefined
? `${date.getUTCFullYear()}-${date.getUTCMonth() + 1}-${date.getUTCDate()}`
: '';
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment