Chamilo is a learning management system focused on ease of use and accessibility
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
chamilo-lms/assets/vue/utils/dates.js

16 lines
348 B

10 months ago
const { DateTime } = require("luxon")
10 months ago
const formatDateTime = function (date) {
if (!date) return null
10 months ago
return DateTime(date).format("DD/MM/YYYY")
}
10 months ago
const formatDateTimeFromISO = function (dateStr) {
if (!dateStr) return ""
10 months ago
return DateTime.fromISO(dateStr).toFormat("dd/LL/yyyy HH:mm")
}
10 months ago
export { formatDateTime, formatDateTimeFromISO }