Fix Chrome/Edge compatibility
Chrome does not support valueAsDate on datetime-local inputs
This commit is contained in:
parent
4e4248a9ae
commit
e016afbf45
@ -133,11 +133,11 @@ function updateBilirubin() {
|
||||
let bilirubin = document.getElementById('bilirubin').valueAsNumber;
|
||||
let gestation = document.getElementById('gestation').valueAsNumber;
|
||||
|
||||
if (document.getElementById('time_birth').valueAsDate === null) {
|
||||
if (document.getElementById('time_birth').value === '') {
|
||||
resultDiv.className = 'hidden';
|
||||
return;
|
||||
}
|
||||
if (document.getElementById('time_measurement').valueAsDate === null) {
|
||||
if (document.getElementById('time_measurement').value === '') {
|
||||
resultDiv.className = 'hidden';
|
||||
return;
|
||||
}
|
||||
@ -150,7 +150,7 @@ function updateBilirubin() {
|
||||
return;
|
||||
}
|
||||
|
||||
let [d, result_text, text_colour, background_colour, accent_colour] = describeBilirubin(gestation, document.getElementById('time_birth').valueAsDate, document.getElementById('time_measurement').valueAsDate, bilirubin);
|
||||
let [d, result_text, text_colour, background_colour, accent_colour] = describeBilirubin(gestation, new Date(document.getElementById('time_birth').value), new Date(document.getElementById('time_measurement').value), bilirubin);
|
||||
|
||||
chart.data.datasets[2].data = [{x: d, y: bilirubin}];
|
||||
chart.update();
|
||||
|
Loading…
Reference in New Issue
Block a user