Design comparison
Solution retrospective
first time using sass. i like it :). sadly i cant fix error prompt and letter input.
Community feedback
- @matiasluduena23Posted over 1 year ago
Hi @giiancarlonv! Good work! Just three advice that could help you on this and next projects. You can used
input.value.trim()
to eliminate the white spaces in the input.You can used
if(!inputVal){...error}
to check if the input is empty.And to check if a Date is valid you can create the date with your inputs and test. First your create your date.
const date = new Date(inputYearVal, inputMonthVal -1, inputDayVal)
and check if the date that you create is valid
if(
date.getFullYear() != inputYearVal) {invalid, sendError()}
if(
date.getMonth() != inputMonthVal -1) {invalid, sendError()}
if(
date.getDate() != inputDayVal) {invalid, sendError()}
I hope this can help you! good code!
Marked as helpful1
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord