I’m getting an with Date picker using the AutogridView with AutoForm (it also happens with TextInput with the type Date) not sure what I need to add to make it work
The UI Components (or Web UIs) doesn’t include any additional support for localization above what’s provided in Web Browsers by default. If you submit a feature request for it, please include an example of what a localized control should be rendered as instead.
Just so its clear, the only effect of the declarative formatting functions e.g. [IntlDateTime] is to change how the results are displayed as seen in your screenshot, they have no effect on the Form Input control that’s rendered. For that you can use the [Input] attribute which should allow changing most of the HTML Input attributes.
The html input I’m trying to render is a date picker.
The picker input on the AutoForm is fine its just the value and it looks like if you don’t change the date value on AutoForm and click save it sends back the date with the incorrect value.
Would be good to pass the correct date value to the input in the first instance.
Would the function dateInputFormat have something to do with it? For a Date only field we shouldn’t try and get the etc time which is causing the issue?
function dateInputFormat(value: Date | string | Object) {
if (value == null || typeof value == 'object') return ''
const d = toDate(value)
if (d == null || d.toString() == 'Invalid Date') return ''
// Use local time to format for input[type=date]
const year = d.getFullYear()
const month = String(d.getMonth() + 1).padStart(2, '0')
const day = String(d.getDate()).padStart(2, '0')
return `${year}-${month}-${day}`
}