I have a tile inside a template and I want it to show a date:
<template>
<px-tile
description=[[date]]
</px-tile>
</template>
Where date
is a property of the element:
date: {
type: Date,
}
This will however display the whole date and time, and I only want the date. So I'm trying to do:
<template>
<px-tile
description=[[date.toLocaleDateString("en-US")]]
</px-tile>
</template>
But this doesn't work. How can I format the date in this setup?