I have tried to change USA MM/dd/yyyy format to Finnish dd.MM.yyyy and also add time part in HH:mm:ss to html5 web form page. I have tried it with editing datetime parameter editor customization from these links guidance:
https://docs.telerik.com/reporting/html5-report-viewer-howto-custom-parameter-editor
https://www.telerik.com/forums/report-parameter-datetime-picker-format-on-ui#WWhMNlOLgEODawH80sWuzg
https://docs.telerik.com/kendo-ui/api/javascript/ui/datetimepicker
but format is still MM/dd/yyyy when displayed and no time possible to select or set
My project is mainly copy from your html5 web form example where I have added script part is next:
<script type=
"text/javascript"
>
$(document).ready(
function
() {
$(
"#reportViewer1"
)
.telerik_ReportViewer({
reportServer:
"~/"
,
parameterEditors: [
{
match:
function
(parameter) {
return
parameter.type ===
"System.DateTime"
;
},
createEditor:
function
(placeholder, options) {
$(placeholder).html(
'<input type="datetime"/>'
);
var
dateTimePicker = $(placeholder),
parameter,
valueChangedCallback = options.parameterChanged,
dropDownList;
function
onChange() {
var
dtv =
this
.value();
if
(
null
!== dtv) {
dtv = myadjustTimezone(dtv);
}
valueChangedCallback(parameter, dtv);
}
return
{
beginEdit:
function
(param) {
parameter = param;
var
dt =
null
;
try
{
if
(param.value) {
dt = myunadjustTimezone(param.value);
}
}
catch
(e) {
dt =
null
;
}
$(dateTimePicker).find(
"input"
).kendoDateTimePicker({
format:
"dd.MM.yyyy HH:mm:ss"
,
parseFormats: [
"MM.dd.yyyy"
,
"HH:mm:ss"
],
change: onChange,
value: dt
});
dropDownList = $(dateTimePicker).find(
"input"
).data(
"kendoDateTimePicker"
);
}
}
}
}]
});
});
function
myadjustTimezone(date) {
return
new
Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()));
};
function
myunadjustTimezone(date) {
return
new
Date(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds(), date.getUTCMilliseconds());
};
</script>
Regards
Harri