1
0
mirror of https://github.com/dwaxweiler/connector-mobilizon synced 2025-06-05 21:59:25 +02:00

remove unneeded folder

This commit is contained in:
Daniel Waxweiler
2021-12-14 17:51:13 +01:00
parent d32320a540
commit d5419448e1
29 changed files with 8 additions and 10 deletions

42
source/front/formatter.js Normal file
View File

@ -0,0 +1,42 @@
import DateTimeWrapper from './date-time-wrapper'
export default class Formatter {
static formatDate({ locale, timeZone, start, end, isShortOffsetNameShown }) {
const startDateTime = new DateTimeWrapper({
locale,
text: start,
timeZone,
})
const endDateTime = new DateTimeWrapper({ locale, text: end, timeZone })
let dateText = startDateTime.getShortDate()
dateText += ' ' + startDateTime.get24Time()
if (!startDateTime.equalsDate(endDateTime)) {
if (isShortOffsetNameShown) {
dateText += ' (' + startDateTime.getShortOffsetName() + ')'
}
dateText += ' - '
dateText += endDateTime.getShortDate() + ' '
} else {
dateText += ' - '
}
dateText += endDateTime.get24Time()
if (isShortOffsetNameShown) {
dateText += ' (' + endDateTime.getShortOffsetName() + ')'
}
return dateText
}
static formatLocation({ description, locality }) {
let location = ''
if (description) {
location += description
}
if (location && locality) {
location += ', '
}
if (locality) {
location += locality
}
return location
}
}