Sorry for asking numerous questions lately. I have been searching for answers but cant seem to get it right.
I want to create a date picker and then format the date picked. I can pick but can seem to figure out how to formate with DateFormatter().
let bdate = await showDatePicker()
console.log(bdate)
async function showDatePicker() {
let picker = new DatePicker()
let bdate = await picker.pickDate()
return bdate
}
let format = new DateFormatter(bdate)
let formatted = format.useShortDateStyle()
console.log(formatted)
I haven’t gotten to this but then will want to calculate the time between date picked and another. If difference less than a year will want to display in months, but if greater than 1 year will want to display in years and months