@ozen-ui/kit
Version:
React component library
10 lines (9 loc) • 399 B
JavaScript
export var formatDateToString = function (date) {
if (!date) {
return '';
}
var year = new Intl.DateTimeFormat('en', { year: 'numeric' }).format(date);
var month = new Intl.DateTimeFormat('en', { month: '2-digit' }).format(date);
var day = new Intl.DateTimeFormat('en', { day: '2-digit' }).format(date);
return "".concat(day, ".").concat(month, ".").concat(year);
};