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

30th Oct 2018, 7:18 PM
Nidhal Baccouri
6 ответов
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)
30th Oct 2018, 8:16 PM
KrOW
KrOW - avatar
+ 1
thnx man
30th Oct 2018, 8:23 PM
Nidhal Baccouri
+ 1
👍👍👍
30th Oct 2018, 8:26 PM
KrOW
KrOW - avatar
+ 1
It giving only the wrong day. You should change the array var days = [ 'sunday', 'monday', 'thuesday' 'wednesday', 'Thursday', 'Friday', 'saturday' ];
30th Oct 2018, 8:59 PM
Mirko Klotzsche
Mirko Klotzsche - avatar
0
you have to use input.value because input is the variable that contains your element
30th Oct 2018, 7:37 PM
Etabeta1🇮🇹
Etabeta1🇮🇹 - avatar
0
I already used input.value 😞
30th Oct 2018, 7:46 PM
Nidhal Baccouri