Topic: Can I remove the comma in the datetimeformat for a datetimepicker?
ikan_nak
priority
asked 18 hours ago
When replacing an old Struts based datepicker component with a Bootstrap datetimepicker, I've found that the datetimepicker result value has a comma between the date and time. This comma causes problems when parsing the result on the server side because we use strict parsing using a globally defined datetimeformat. While I have found a way to strip it out before parsing the value itelf, I would like to remove this comma on the client side, but I am unable to find a way to do so using the options API.
This is my current JavaScript to initialize this component:
function initDateTimePicker(/** DomNode */ dateTimePicker) {
initMDB({ Datetimepicker, Input });
var disablePast = dateTimePicker.dataset?.kobeeDisablePast;
new Datetimepicker(dateTimePicker, {
datepicker: {
format: 'yyyy-mm-dd',
confirmDateOnSelect: true,
disablePast: disablePast ?? false
},
timepicker: {
format12: false,
format24: true
}
});
}
var KobeeDateTimePicker = {
initDateTimePicker
}
Is there any option or change I can make to do this that will allow me to remove the comma from the datetime value? Looking through the code, it appears this comma might be hardcoded, but I'm not familiar enough with the code to fully establish that...
Kamila Pieńkowska
staff
answered 20 minutes ago
Unfortunately the coma is hardcoded. We do not provide an option to customize that.
If you need you can only parse it with JS while processing form before sending it to the server.
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- ForumUser: Priority
- Premium support: Yes
- Technology: MDB Standard
- MDB Version: MDB5 8.1.0
- Device: Desktop computer
- Browser: Edge
- OS: Windows 11
- Provided sample code: No
- Provided link: No