add ticketing url
This commit is contained in:
parent
bf2eddd34f
commit
37a84058d1
6 changed files with 81 additions and 10 deletions
|
|
@ -39,6 +39,7 @@ async function getMapadoDates(monthNumb) {
|
|||
{ name: 'ticketing', subfields: [
|
||||
{ name: "@id", },
|
||||
{ name: "title", },
|
||||
{ name: "slug", },
|
||||
{ name: "venue", subfields: [
|
||||
{ name: "@id" },
|
||||
{ name: "address" },
|
||||
|
|
@ -70,14 +71,32 @@ async function getMapadoDates(monthNumb) {
|
|||
);
|
||||
|
||||
const mapadoDates = eventDates.map((eventDate) => {
|
||||
const date = eventDate.startDate.slice(0, 10);
|
||||
const splittedDate = date.split("-");
|
||||
const day = splittedDate[2];
|
||||
return {
|
||||
day: day,
|
||||
name: eventDate.ticketing.title,
|
||||
day: getDay(eventDate),
|
||||
title: eventDate.ticketing.title,
|
||||
startTime: getStartTime(eventDate),
|
||||
ticketingUrl: getTicketingUrl(eventDate)
|
||||
};
|
||||
});
|
||||
|
||||
return mapadoDates;
|
||||
}
|
||||
|
||||
function getDay(eventDate) {
|
||||
const date = eventDate.startDate.slice(0, 10);
|
||||
const splittedDate = date.split("-");
|
||||
const day = splittedDate[2];
|
||||
return day
|
||||
}
|
||||
|
||||
function getStartTime(eventDate) {
|
||||
const rawTime = eventDate.startDate.slice(11, 19);
|
||||
const time = dayjs(`2000-01-01T${rawTime}`);
|
||||
const formattedTime = time.format('HH[h]mm');
|
||||
return formattedTime
|
||||
}
|
||||
|
||||
function getTicketingUrl(eventDate) {
|
||||
const baseUrl = "https://cdn-besancon.mapado.com/event/"
|
||||
return baseUrl + eventDate.ticketing.slug
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue