Commit b306096b authored by Luzian Bieri's avatar Luzian Bieri
Browse files

Edited time/date- and price-display

parent 27f16721
......@@ -163,6 +163,31 @@
"errors.shown_language": "Zeige Text in %{shown_language}",
"filtered_list.show_filter": "Filter anzeigen",
"filtered_list.hide_filter": "Filter verstecken",
"filtered_list.show_list": "Zurück zur Übersicht"
"filtered_list.show_list": "Zurück zur Übersicht",
"date.at": "um",
"date.oclock": "Uhr",
"date.weekdays%n":[
[0, 0, "Sonntag"],
[1, 1, "Montag"],
[2, 2, "Dienstag"],
[3, 3, "Mittwoch"],
[4, 4, "Donnerstag"],
[5, 5, "Freitag"],
[6, 6, "Samstag"]
],
"date.months%n":[
[0, 0, "Januar"],
[1, 1, "Februar"],
[2, 2, "März"],
[3, 3, "April"],
[4, 4, "Mai"],
[5, 5, "Juni"],
[6, 6, "Juli"],
[7, 7, "August"],
[8, 8, "September"],
[9, 9, "Oktober"],
[10, 10, "November"],
[11, 11, "Dezember"]
]
}
}
......@@ -163,6 +163,31 @@
"events.emailsignup_fail": "Sign up failed. Try again later.",
"filtered_list.show_filter": "Show filter",
"filtered_list.hide_filter": "Hide filter",
"filtered_list.show_list": "Back to the list"
"filtered_list.show_list": "Back to the list",
"date.at": "at",
"date.oclock": "",
"date.weekdays%n":[
[0, 0, "Sunday"],
[1, 1, "Monday"],
[2, 2, "Tuesday"],
[3, 3, "Wednesday"],
[4, 4, "Thursday"],
[5, 5, "Friday"],
[6, 6, "Saturday"]
],
"date.months%n":[
[0, 0, "January"],
[1, 1, "February"],
[2, 2, "March"],
[3, 3, "April"],
[4, 4, "May"],
[5, 5, "June"],
[6, 6, "July"],
[7, 7, "August"],
[8, 8, "September"],
[9, 9, "October"],
[10, 10, "November"],
[11, 11, "December"]
]
}
}
......@@ -47,4 +47,13 @@
.past {
background-color: #bbb;
}
.weekday {
font-size: 2em;
}
.date {
width: 100%;
font-size: .8em;
text-align: right;
}
}
......@@ -173,9 +173,29 @@ export default class EventDetails {
} else {
eventSignupForm = m('div', i18n('events.registration_starts_at', { time: registerStart }));
}
const d = new Date(event.time_start);
const day = `${i18n('date.weekdays%n', d.getDay())}, ${d.getDate()}. ${i18n('date.months%n', d.getMonth())} ${d.getFullYear()} `;
const time = `${i18n('date.at', )} ${d.getHours()}:${((d.getMinutes() < 10) ? '0' : '')}${d.getMinutes()}`;
let price = ''; //Dies wäre cooler gewesen, fand aber Sandro nicht so toll;) const price = event.price ? `CHF ${Math.floor(event.price/100) + '.' + (((event.price%100) == 0) ? '-' : ((event.price%100<10) ? '0': '') + event.price%100)}` : i18n('events.free');
if (event.price) {
price += 'CHF ' + Math.floor(event.price/100) + '.' +
(event.price%100 == 0
? '-'
: (event.price%100<10
? +'0'
: +''
+ event.price%100));
}
else{
price = i18n('events.free');
}
return m('div.event-details', [
m('h1', event.getTitle()),
m('div', event.time_start),
m('div', day + time + ' '+ i18n('date.oclock', )),
m('div', i18n('events.price', ) + ': ' + price),
m(
'div',
event.spots === undefined
......
......@@ -172,8 +172,26 @@ export default class EventList extends FilteredListPage {
static _renderEventListItem(event, className = '') {
const imageurl = event.img_poster ? `${apiUrl}${event.img_poster.file}` : AmivLogo;
const price = event.price ? `Fr. ${event.price}` : i18n('events.free');
return m(
let price = ''; //Dies wäre cooler gewesen, fand aber Sandro nicht so toll;) const price = event.price ? `CHF ${Math.floor(event.price/100) + '.' + (((event.price%100) == 0) ? '-' : ((event.price%100<10) ? '0': '') + event.price%100)}` : i18n('events.free');
if (event.price) {
price += 'CHF ' + Math.floor(event.price/100) + '.' +
(event.price%100 == 0
? '-'
: (event.price%100<10
? +'0'
: +''
+ event.price%100));
}
else{
price = i18n('events.free');
}
const d = new Date(event.time_start);
const day = i18n('date.weekdays%n', d.getDay()) + ', '
const date = `${d.getDate()}. ${i18n('date.months%n', d.getMonth()).slice(0, 3)} ${d.getFullYear()}`;
return m(
'div',
{
class: `list-item ${className}`,
......@@ -190,7 +208,7 @@ export default class EventList extends FilteredListPage {
},
[
m('h2', event.getTitle()),
m('div', [m('span', price), m('span', event.time_start.slice(0, -10))]),
m('div', [m('span', price), m('span', [m('div.weekday', day), m('div.date', date)])]),
]
),
]
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment