wip migration

This commit is contained in:
María
2025-08-14 15:12:29 +02:00
commit 61d96ac328
148 changed files with 31438 additions and 0 deletions

29
utils/dataProcessing.js Normal file
View File

@@ -0,0 +1,29 @@
const dataProcessing = {
isValidUrl(url) {
if (url) return /^(ftp|http|https):\/\/[^ "]+\.+[^ "]+$/.test(url)
else return true
},
formatDatetime(date) {
let d = new Date(date)
let month = '' + (d.getMonth() + 1)
let day = '' + d.getDate()
let year = d.getFullYear()
if (month.length < 2) month = '0' + month
if (day.length < 2) day = '0' + day
let formattedDate = [day, month, year].join('/')
let hour = d.getHours()
let minutes = d.getMinutes()
let formattedTime = [hour, minutes].join(':')
let formattedDatetime = [formattedDate, formattedTime].join(' ')
return formattedDatetime
},
}
export default dataProcessing