|
|
@ -5,30 +5,28 @@
|
|
|
|
/** @type number */ export let templateIndex;
|
|
|
|
/** @type number */ export let templateIndex;
|
|
|
|
import { date } from '$lib/stores/store';
|
|
|
|
import { date } from '$lib/stores/store';
|
|
|
|
|
|
|
|
|
|
|
|
/** @typedef
|
|
|
|
/** @type {string} */ let newdate;
|
|
|
|
* {{
|
|
|
|
|
|
|
|
* date: string;
|
|
|
|
|
|
|
|
* }} Newdate
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** @type {Newdate} */ let newdate = { date: '' };
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const convertDate = (/** @type {(string | undefined)} */ datetime) => {
|
|
|
|
/**
|
|
|
|
if (datetime == undefined) {
|
|
|
|
* @param {string} date - Fecha del evento
|
|
|
|
return {
|
|
|
|
* @returns {string} - Fecha en dia (número) mes (letras)
|
|
|
|
date: ''
|
|
|
|
*/
|
|
|
|
};
|
|
|
|
const convertDate = (date) => {
|
|
|
|
|
|
|
|
if (date == undefined) {
|
|
|
|
|
|
|
|
return '';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/** @type {string} */ const monthNumber = datetime.split('-')[1];
|
|
|
|
/** @type {string} */ const monthNumber = date.split('-')[1];
|
|
|
|
/** @type {string} */ let day = datetime.split('-')[2].split('T')[0];
|
|
|
|
/** @type {string} */ let day = date.split('-')[2].split('T')[0];
|
|
|
|
/** @type {number} */ const dayNumber = Number(day);
|
|
|
|
/** @type {number} */ const dayNumber = Number(day);
|
|
|
|
/** @type {string} */ const month = getMonthName(monthNumber);
|
|
|
|
/** @type {string} */ const month = getMonthName(monthNumber);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** Removes 0 on single digit days */
|
|
|
|
if (dayNumber < 10) {
|
|
|
|
if (dayNumber < 10) {
|
|
|
|
day = day.charAt(1);
|
|
|
|
day = day.charAt(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return {
|
|
|
|
|
|
|
|
date: `${day} de ${month}`
|
|
|
|
/** @type {string} */ const res = `${day} ${month}`;
|
|
|
|
};
|
|
|
|
return res;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
$: if ($date !== '') {
|
|
|
|
$: if ($date !== '') {
|
|
|
@ -36,7 +34,7 @@
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
{#if templates[templateIndex] && newdate.date}
|
|
|
|
{#if templates[templateIndex] && newdate}
|
|
|
|
<div
|
|
|
|
<div
|
|
|
|
class="date"
|
|
|
|
class="date"
|
|
|
|
style="
|
|
|
|
style="
|
|
|
@ -52,7 +50,7 @@
|
|
|
|
line-height: {templates[templateIndex].date.lineHeight}rem;
|
|
|
|
line-height: {templates[templateIndex].date.lineHeight}rem;
|
|
|
|
"
|
|
|
|
"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
{newdate.date}
|
|
|
|
{newdate}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{/if}
|
|
|
|
{/if}
|
|
|
|
|
|
|
|
|
|
|
|