Hello
I'm displaying a time in an input field with maskedTextbox on it. I allow the user to specify his preferred time format:
hh:mm:ss or hh.mm.ss. or hh/mm/ss (hours:minutes:seconds)
It works fine working with the separator : and / but not with . (dot). Here is a working example showing you that the dot is overwritten by a coma:
<!DOCTYPE html>
<
html
>
<
head
>
<
title
></
title
>
<
link
rel
=
"stylesheet"
href
=
"http://kendo.cdn.telerik.com/2017.3.1026/styles/kendo.common.min.css"
>
<
link
rel
=
"stylesheet"
href
=
"http://kendo.cdn.telerik.com/2017.3.1026/styles/kendo.default.min.css"
>
<
link
rel
=
"stylesheet"
href
=
"http://kendo.cdn.telerik.com/2017.3.1026/styles/kendo.default.mobile.min.css"
/>
<
script
src
=
"http://kendo.cdn.telerik.com/2017.3.1026/js/jquery.min.js"
></
script
>
<
script
src
=
"http://kendo.cdn.telerik.com/2017.3.1026/js/kendo.all.min.js"
></
script
>
<
script
src
=
"http://kendo.cdn.telerik.com/2017.3.1026/js/cultures/kendo.culture.de-DE.min.js"
></
script
>
<!-- This works fine
<script src="http://kendo.cdn.telerik.com/2017.3.1026/js/cultures/kendo.culture.de-CH.min.js"></script>
-->
</
head
>
<
script
type
=
"text/javascript"
>
$(document).ready(function() {
kendo.culture("de-DE"); // Same problem with 'de-AT'
// kendo.culture("de-CH"); // This works fine
$(".maskTimer").kendoMaskedTextBox({
mask: "h0.t0.t0",
rules: {h: /[0-2]/, t: /[0-5]/}
});
});
</
script
>
<
body
>
<
div
>
<
input
id
=
"time"
class
=
"maskTimer"
style
=
"width: 100px;"
value
=
"120000"
>
</
div
>
</
body
>
</
html
>
After starting the script you see the time this way: 12,00,00 (coma instead of dot as defined in kendoMaskedTextBox -> mask). If you use colon (:) or slash (/) it works fine as well. It also works using f.e. the culture 'de-CH' but not for 'de-AT' (same behaviour as 'de-DE'). I have no clue about this behaviour for other countries. I have no idea why/how the coma overwrites my defined time format. Maybe I'm doing something simple wrong.
Another weird behaviour: If you delete the time in the input field you can see the correct mask: __.__.__ but when you start entering a new time the dot will be replaced by a coma as soon as you pass the first dot (by typing). All weird to me. As far as I know Germany (de-DE) and Austria (de-AT) use : or . as time separator and not a coma, so this can't be any default value for those countries. Can you explain me this or even better what I did wrong?
Regards