degachejs
Version:
A Tunisian utility library for working with CIN, phone numbers, addresses, and more
19 lines (18 loc) • 521 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.formatDate = void 0;
/**
* Formats a date according to Tunisian locale
* @param date - The date to format
* @param options - Intl.DateTimeFormat options
* @returns formatted date string
*/
const formatDate = (date, options = {
year: "numeric",
month: "long",
day: "numeric",
}) => {
const formatter = new Intl.DateTimeFormat("ar-TN", options);
return formatter.format(date);
};
exports.formatDate = formatDate;