2020-02-19 12:26:44 +01:00
|
|
|
export interface DateChoice {
|
2020-04-14 11:28:33 +02:00
|
|
|
literal: string;
|
|
|
|
timeList: TimeSlices[];
|
|
|
|
date_object: Date;
|
2020-02-19 12:26:44 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface TimeSlices {
|
2020-04-14 11:28:33 +02:00
|
|
|
literal: string;
|
2020-02-19 12:26:44 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface PollAnswer {
|
2020-04-14 11:28:33 +02:00
|
|
|
id: number;
|
|
|
|
text: string;
|
|
|
|
url: string;
|
|
|
|
file: string;
|
|
|
|
literal: string;
|
|
|
|
date_object: Date;
|
|
|
|
timeList: TimeSlices[];
|
2020-02-19 12:26:44 +01:00
|
|
|
}
|
|
|
|
|
2020-02-19 17:12:54 +01:00
|
|
|
const currentYear = new Date().getFullYear();
|
|
|
|
const currentMonth = new Date().getMonth();
|
|
|
|
const currentDay = new Date().getDate();
|
|
|
|
|
2020-04-14 11:28:33 +02:00
|
|
|
export const basicSlicesOfDay: TimeSlices[] = [{ literal: 'matin' }, { literal: 'midi' }, { literal: 'soir' }];
|
2020-02-19 12:26:44 +01:00
|
|
|
export const otherSlicesOfDay: TimeSlices[] = [
|
2020-04-14 11:28:33 +02:00
|
|
|
{ literal: 'aux aurores' },
|
|
|
|
{ literal: 'au petit dej' },
|
|
|
|
{ literal: 'au deuxième petit dej des hobbits' },
|
2020-02-13 17:41:36 +01:00
|
|
|
];
|
2020-02-19 12:26:44 +01:00
|
|
|
export const defaultTimeOfDay: TimeSlices[] = (() => {
|
2020-04-14 11:28:33 +02:00
|
|
|
return [...basicSlicesOfDay];
|
2020-02-19 12:26:44 +01:00
|
|
|
})();
|
|
|
|
|
|
|
|
export const otherTimeOfDay: TimeSlices[] = (() => {
|
2020-04-14 11:28:33 +02:00
|
|
|
return [...otherSlicesOfDay];
|
2020-02-19 12:26:44 +01:00
|
|
|
})();
|
2020-02-19 17:23:24 +01:00
|
|
|
export const moreTimeOfDay: TimeSlices[] = (() => {
|
2020-04-14 11:28:33 +02:00
|
|
|
return [...otherSlicesOfDay];
|
2020-02-19 17:23:24 +01:00
|
|
|
})();
|
2020-02-19 12:26:44 +01:00
|
|
|
export const defaultDates: DateChoice[] = [
|
2020-01-20 14:36:26 +01:00
|
|
|
{
|
2020-02-19 17:12:54 +01:00
|
|
|
literal: `${currentYear}-${currentMonth}-${currentDay}`,
|
2020-01-24 11:15:38 +01:00
|
|
|
date_object: new Date(),
|
2020-04-14 11:28:33 +02:00
|
|
|
timeList: defaultTimeOfDay,
|
2020-02-13 17:41:36 +01:00
|
|
|
},
|
|
|
|
{
|
2020-02-19 17:12:54 +01:00
|
|
|
literal: `${currentYear}-${currentMonth}-${currentDay + 1}`,
|
2020-02-13 17:41:36 +01:00
|
|
|
date_object: new Date(),
|
2020-04-14 11:28:33 +02:00
|
|
|
timeList: defaultTimeOfDay,
|
2020-02-13 17:41:36 +01:00
|
|
|
},
|
|
|
|
{
|
2020-02-19 17:12:54 +01:00
|
|
|
literal: `${currentYear}-${currentMonth}-${currentDay + 2}`,
|
2020-02-13 17:41:36 +01:00
|
|
|
date_object: new Date(),
|
2020-04-14 11:28:33 +02:00
|
|
|
timeList: defaultTimeOfDay,
|
|
|
|
},
|
2020-02-13 17:41:36 +01:00
|
|
|
];
|
2020-02-19 17:12:54 +01:00
|
|
|
|
2020-02-19 12:26:44 +01:00
|
|
|
export const otherDefaultDates: DateChoice[] = [
|
2020-02-13 17:41:36 +01:00
|
|
|
{
|
2020-02-19 17:12:54 +01:00
|
|
|
literal: `${currentYear}-${currentMonth}-${currentDay}`,
|
2020-02-13 17:41:36 +01:00
|
|
|
date_object: new Date(),
|
2020-04-14 11:28:33 +02:00
|
|
|
timeList: defaultTimeOfDay,
|
2020-01-20 14:36:26 +01:00
|
|
|
},
|
|
|
|
{
|
2020-02-19 17:12:54 +01:00
|
|
|
literal: `${currentYear}-${currentMonth}-${currentDay + 1}`,
|
|
|
|
date_object: new Date(currentYear, currentMonth, currentDay + 1),
|
2020-04-14 11:28:33 +02:00
|
|
|
timeList: otherTimeOfDay,
|
2020-01-20 14:36:26 +01:00
|
|
|
},
|
|
|
|
{
|
2020-02-19 17:12:54 +01:00
|
|
|
literal: `${currentYear}-${currentMonth}-${currentDay + 2}`,
|
2020-01-24 11:15:38 +01:00
|
|
|
date_object: new Date(),
|
2020-04-14 11:28:33 +02:00
|
|
|
timeList: moreTimeOfDay,
|
|
|
|
},
|
2020-01-20 14:36:26 +01:00
|
|
|
];
|
2020-04-14 11:28:33 +02:00
|
|
|
export const defaultAnswers: PollAnswer[] = [
|
|
|
|
{
|
|
|
|
id: 0,
|
|
|
|
text: 'réponse de démo 1',
|
|
|
|
file: '',
|
|
|
|
url:
|
|
|
|
'https://mastodon.cipherbliss.com/system/media_attachments/files/001/439/118/original/6fcf149bd902841b.png?1579471574',
|
|
|
|
literal: `${currentYear}-${currentMonth}-${currentDay}`,
|
|
|
|
date_object: new Date(),
|
|
|
|
timeList: otherSlicesOfDay,
|
|
|
|
},
|
2020-01-20 14:36:26 +01:00
|
|
|
{
|
|
|
|
id: 1,
|
|
|
|
text: 'réponse 2',
|
2020-02-19 17:12:54 +01:00
|
|
|
file: '',
|
2020-04-14 11:28:33 +02:00
|
|
|
url:
|
|
|
|
'https://mastodon.cipherbliss.com/system/media_attachments/files/001/439/118/original/6fcf149bd902841b.png?1579471574',
|
2020-02-19 17:12:54 +01:00
|
|
|
literal: `${currentYear}-${currentMonth}-${currentDay + 1}`,
|
2020-01-24 11:15:38 +01:00
|
|
|
date_object: new Date(),
|
2020-04-14 11:28:33 +02:00
|
|
|
timeList: basicSlicesOfDay,
|
2020-01-20 14:36:26 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
id: 2,
|
|
|
|
text: 'la réponse D',
|
2020-02-19 17:12:54 +01:00
|
|
|
file: '',
|
2020-04-14 11:28:33 +02:00
|
|
|
url:
|
|
|
|
'https://mastodon.cipherbliss.com/system/media_attachments/files/001/439/118/original/6fcf149bd902841b.png?1579471574',
|
2020-02-19 17:12:54 +01:00
|
|
|
literal: `${currentYear}-${currentMonth}-${currentDay + 2}`,
|
2020-01-24 11:15:38 +01:00
|
|
|
date_object: new Date(),
|
2020-04-14 11:28:33 +02:00
|
|
|
timeList: otherSlicesOfDay,
|
|
|
|
},
|
|
|
|
];
|