@eddybpro
Posted
Hi, Joutee
Congratulation on finishing this challenge, I hope it was fun.
For the code here are some suggestions that might help improve it:
- CSS code:
body{
/*add this line*/
overflow: hidden;
}
- JS code:
//You did not check for the leap years, eg: 2000;
// here is a way to deal with it:
if(year % 400 == 0 || (year % 100 != 0 && year % 4 == 0)){
//leap year
//Update the value of the second month
daysOfMonths[1] = 29;
}else{
daysOfMonths[1] = 28;
}
//You can also add the prefix 0 in front of values in the inputs like this:
inputEle.addEventListener('change', ()=>{
if(inputEle.value.length==1){
let val = inputEle.value;
inputEle.value = '0' + val;
}
})
Tips
For the CSS UNITS
, The em
unit is relative to the font size of its parent element, while the rem
unit is only relative to the root font size of the HTML document. The “r” in rem stands for “root”.
That's it HAPPY CODING
Marked as helpful
@Joutee
Posted
@eddybpro Thanks for reply, I 'm aware of leap years. I didn't want to bother about it because i already did it before and wanted to jump to other projects. Also thans for advice.