0
Can someone tell why this Code ist Not working? ?
im new to web developememt and its really wierd i cant See the Bug in this code!! https://code.sololearn.com/Wed6XE1p78kA/?ref=app
6 Answers
0
You init input at window.load time only and in that time, its ALWAYS an empty string then using Date(input) you will get an invalide date object (then an invalid day). In practice, get the input var on button click
P.S. Warn that new Date(String) and Date.parse behaviour its not equals across multiple browsers (some can parse an input format, others not)
+ 1
thnx man
+ 1
đđđ
+ 1
It giving only the wrong day. You should change the array
var days = [ 'sunday',
'monday',
'thuesday'
'wednesday',
'Thursday',
'Friday',
'saturday'
];
0
you have to use input.value because input is the variable that contains your element
0
I already used input.value đ