formatted date en el checkout

This commit is contained in:
Jaume Solís 2024-04-16 15:26:05 +02:00
parent e2c06060e4
commit 9e41a30083
2 changed files with 6 additions and 3 deletions

View File

@ -110,8 +110,11 @@ export function useCheckoutForm() {
};
const getFormatedDate = (date) => {
let dated = new Date(date)
return dated.toISOString();
if(date){
let dated = new Date(date.replace('Z', ''));
return `${dated.toLocaleString('es-ES', { day: "numeric" })} de ${dated.toLocaleString('es-ES', { month: "short" })} - De 10h - 12h`;
}
return '';
}
// TODO hacer el await de las provincias

View File

@ -316,7 +316,7 @@ export default defineComponent({
</header>
<div class="checkout-delivery-body">
<p class="green-text">{{ getFormatedDate() }} - De 11h - 12 h</p>
<p class="green-text">{{ getFormatedDate((cart.length > 0)?cart[0].dated:'') }}</p>
</div>
</div>