For those like me who did not understand the JS code of line 22: Here's a step-by-step breakdown: 1. new Date().toISOString(): new Date() creates a new JavaScript Date object representing the current date and time. .toISOString() converts the Date object to a string in ISO format, which looks like this: "YYYY-MM-DDTHH:mm:ss.sssZ". This format includes the date, time, and timezone information. 2. .split("T"): .split("T") is a method that splits the string into an array of substrings using the "T" character as the separator. After the split, you get an array with two elements: the date part before "T" and the time part after "T". 3. [0]: [0] retrieves the first element of the array, which is the date part. 4. "userInput.max = ...": userInput refers to an HTML input element, likely of type "date". The .max attribute sets the maximum allowed value for the date input. Putting it all together, the line of code sets the maximum date for the input element to the current date. It extracts the date part from the ISO string format and assigns it to the max attribute. This ensures that users cannot select a date beyond the current date when using the input field. (thanks to chatGPT for the explanation)
@saurabhvlogssss000110 ай бұрын
thanku brother for explaining
@DanielDaniel-ce1vg8 ай бұрын
Bless u bro
@victorylab25256 ай бұрын
Thanks Alot
@zeissgaming91815 ай бұрын
Awesome ❤
@Applecitylightkiwi Жыл бұрын
people always said hey man use date api in js, date methods in js is a headache, now i understand why
@anmolyadav7105 Жыл бұрын
This types of projects are beneficial for us beginners. Can't thank you enough!
@rajbarua77859 ай бұрын
bruh what is your skill level right now???
@almudrikal95284 ай бұрын
@@rajbarua7785 why you asking that
@CollegeNotes Жыл бұрын
Hello Mr. Easy Tutorials! I really appreciate this project tutorial and all the work you put into it. Huge thanks for your efforts! In my implementation I wanted to change the 'days' to 'day' when d3 === 1, and the same with months and years, so I did this slight adjustment creating variables with a ternary operator to pluralise these words whenever the value was not exactly equal to 1: let pluralDays = d3 !== 1 ? "days" : "day"; let pluralMonths = m3 !== 1 ? "months" : "month"; let pluralYears = y3 !== 1 ? "years" : "year"; then the template literal was: result.innerHTML = `You are ${y3} ${pluralYears}, ${m3} ${pluralMonths} and ${d3} ${pluralDays} old.`; Just thought I'd post this here in case anyone else was thinking the same thing! Many thanks, David
@abdullahbinmamun3803 Жыл бұрын
good job
@bmscodehub Жыл бұрын
thanks alot for being a life saver of self taught web developer
@iftyrahman2239 Жыл бұрын
Hello Avinash, Bro next time make a shopping cart tutorial.
@ugyenofficial Жыл бұрын
I cannot leave without thanking you for your free and great resources
@gomeztorricellygomez780810 ай бұрын
I nailed it,works like charm to me
@niranjanvanka376 Жыл бұрын
Hello sir make javascript tutorial Why because in your project we are suffering to understand the js code
@cart0_0n24 Жыл бұрын
everything is great except your explanations ... please explain how syntax are working
@shifteditz063 ай бұрын
Hey guys please help me, : : -webkit-calender-picker-indicator is not working. Displaying small date input in the browser
@steff183 ай бұрын
.input-box input::-webkit-calendar-picker-indicator This is the correct way of spelling it. ( calendar is with an 'a' and not an 'e' ) :)
@maryamheidari3110 Жыл бұрын
Hi thanks for great video But my text align is not exactly under the box ,why?
@sachinkundu2427 Жыл бұрын
Thanks for video can you please upload search functionality with js .. search ..
@Kiran234568 ай бұрын
Untill i become boss you are my boss
@akanimoekong1817 Жыл бұрын
I'm grateful for your lessons, but I have a problem with the WebKit-calender-picker-indicator. It does not seems to be effective on my output. There is no positive response. The should be an indicator of I touch the date on my browser, but nothing changes. please help!
@mirzatahataha246711 ай бұрын
same issue it also looking very small
@GGARIN.C.R7 ай бұрын
Bro it may happen due to browser incompatible
@OlaRsk6 ай бұрын
Maybe you miss the "-" at the beginning
@Mentor_Makhdoom_Shorts4 ай бұрын
it is -webkit-calendar-picker-indicator check the starting...
@manjeet07684 ай бұрын
Set type="date"
@spsanidhya2836 ай бұрын
Thank You that was an easy tutorial.
@andystar444 Жыл бұрын
love the work keep it up boss💯🙏
@icyzenax2501 Жыл бұрын
Big fan Bro You Are Genious in Your Skills
@sanjanasoni10435 ай бұрын
Thanku so much for uploading this it's grt 🙏
@Wideshorts- Жыл бұрын
sir it's displaying 'you are ${y3} years, ${m3} months, ${d3} days old' instead of 3 years, 4months, 3 days old for example.
@JessieAstra10 ай бұрын
same here bro. have you seen a solution to that?
@Wideshorts-10 ай бұрын
@@JessieAstra yes call the function and change the command in printf as your wish to come
@vishalrajput82318 ай бұрын
Bro use template literal == `` `` , Ye vale nahi == ' '
@DavidMunyagwaАй бұрын
@@Wideshorts-am receiving the same error 😢what can I do
@physical_information7 ай бұрын
very good teching style i like it sir
@AnkushKumar-px9dp Жыл бұрын
hey bro after creating the webkit in css my date icon shifted to left side.. please help me out
@T0BC00N Жыл бұрын
add the spaces around the minus(-) in the background-position line... calc(100% - 10px);
@subramanyam6812 ай бұрын
@@T0BC00N Thank you for clearing my doubt too bro
@Tech_with_heart-yt11 күн бұрын
My output is showing you are y3 years, m3 months and d3 days old am not getting tthe correct output when i click the calculate button
@NinjaPro3 Жыл бұрын
UZBEKISTAN , HELLO BROTHER I LOVE YOU
@DavidMunyagwaАй бұрын
hello everyone, thanks a lot but i have a problem why is that i receive 'You are ${y3} years, ${m3} months and ${d3} days old'; when i try to run the web page Age calculator,
@KardanKaaal3 ай бұрын
Today's date is the 12th of August but it is showing the 11th of August. What to do ?
@Kai-Ming054 ай бұрын
Bro everything is fine but when i add js then whatever i input in the calendar it shows 0 what to do next please help 🥺
@Papang209 Жыл бұрын
How about the result will be in the input box?
@ARJUN_030 Жыл бұрын
Big fan anna❤
@konstantinreut2577 Жыл бұрын
Great job, sir!
@dreamer7084 Жыл бұрын
My calendar button is in the format of mm/dd/yyyy and calculate button also not working. If anybody knows let me know guys.
@syedanas4186 Жыл бұрын
Did you add the onlick function on button?
@the_sky_fire Жыл бұрын
For me the .input-box input::-webkit-calendar-picker-indicator is not working I don' t know why. When I searched it said it depends on browser or something. We need to add additional things for this to work. If anyone found this working please reply me back. Thank you in advance
@bilalmuneer877 Жыл бұрын
Calc (100% - 10px) us mines ka agay or pichy space doo phr sahi ho gy ga
@Z_Rokhri Жыл бұрын
What is the reason for not showing my results?
@mvb873 Жыл бұрын
Same it's showing in the console but not in para
@nihalnic Жыл бұрын
I think you are Using ( " ) or( ' ) quota, That's why your code is not working. Use (`) this one and see Magic 😂 Btw sorry for my bad English🙂 im still learning😁
@NoumanEjaz-x3r Жыл бұрын
mine is not shown even in console @@mvb873
@MewANtics3 ай бұрын
new Date() is not showing up as a method for me and I have no clue why.
@manjeshsingh3002 Жыл бұрын
Thanks brother 🙏
@c_h_a_n_dra6302 ай бұрын
my calculate button is not working .what should i do?
@Muhammar_Rabbi Жыл бұрын
you can make video on urdu/hindi language plx
@harshasharma5103 Жыл бұрын
Hello It is not showing anything in console box I have put yr code same but there is nothing
@amshovon1125 Жыл бұрын
Hello, I am watching video and try to code run but problem is don't show calculate years, month, days ,, result show 0days, 0month , 0years....How can i solve this problem??? Please help me. Thank you
@tahashahid4186 Жыл бұрын
if you get the solution plz share with me.
@ayoubbelmouche881811 ай бұрын
i think you wroned in "let d2 = today.getDate()" i guess you write "let d2 = birthDate.getDate()" the same case for m2 and y2
@ichigo23984 Жыл бұрын
Like the tutorial 💚
@ShivaMGupta-go1on Жыл бұрын
my problem is userInput.max its not supported show type error line 23
@vahazbade Жыл бұрын
Like the tutorial 👌
@Karimi.1380 Жыл бұрын
hello bro build a search bar with html css and javascript
@CodeWithBalaji Жыл бұрын
it will fix error if there is no dob selected: if (isNaN(y3) || isNaN(m3) || isNaN(d3)) { result.innerHTML = `Please select your DOB`; } else { result.innerHTML = `You are ${y3} years, ${m3} months and ${d3} days old`; }
@laibaishfaq5564 Жыл бұрын
thank you sir
@Mohsenkardani11 ай бұрын
thank you
@Depstechinsight Жыл бұрын
Why the js part not working does anyone know
@flyflor599 Жыл бұрын
excellent
@Naina_is_not_working7 ай бұрын
.input-box input::-webkit-calendar-picker-indicator ----- this is not working for firefox Solution: try to open in another browser and also check the calc()
@FloriRosenbaum10 ай бұрын
it says nan bcause the console.log doesnt wort but i dunt know why
@jamesjordon-vq4cw Жыл бұрын
Keep it up❤
@Pcmagzine Жыл бұрын
How to make freelance website like fiverr
@sarakhansarakhan792 Жыл бұрын
Ye jo date ko calculate krny ka code likha iski smjh ni ai sir
@_vickyy7 ай бұрын
Date not showing..
@ramyakantipudi4634 Жыл бұрын
My result is showing in console but not after adding result.innerHTML. why can you please tell me whats the wrong
@monk_widom Жыл бұрын
Me to .... solution?
@josefigarola5402 Жыл бұрын
In the html file, you have to add the p tag to display the text then create the variable result that'll change the output after result.innerHTML let result = document.getElementById("result"); This should work :)
@neelumarif568 Жыл бұрын
Please show full code I did but button is not working
@josefigarola5402 Жыл бұрын
Probably you forgot the event listener at the end of the js script userInput.addEventListener("input", calculateAge);
@OlaRsk6 ай бұрын
Can anyone pls explain the last block of code? Line 56-59
@RadwanBenmoussa-n6t9 күн бұрын
Where can I found codes
@salehabdullah-lt7fk Жыл бұрын
Can somebody explain to me this part of the line below ".split("T")[0];" userInput.max = new Date().toISOString().split("T")[0]; and this function : function getDaysInMonths(year, month){ return new Date(year, month, 0).getDate(); } Thanks.
@mohi7109 Жыл бұрын
it's my question too.
@salehabdullah-lt7fk Жыл бұрын
@@mohi7109 kindly let me know when you have an idea about it.
@17-4-4 Жыл бұрын
reply if u find it
@shivanshurawat23094 ай бұрын
@salehabdullah-lt7fk .max signify that the maximum value that should be set and not beyond it . new Date() is refering to the object made of the current date which include something like this 2024-07-23T10:20:30.000Z.Then toISOstring() converts this into string like "2024-07-23T10:20:30.000Z" and then split("T") separate this into different string array elements like ["2024-07-23", "10:20 ",..] and then lastly index 0 is called so it will take "2024-07-23"]
@salehabdullah-lt7fk4 ай бұрын
@@shivanshurawat2309 Thanks for replying
@lukekoletsios3236 Жыл бұрын
thanks
@GreatStackDev Жыл бұрын
you are welcome Koletsios!
@pranavrhegde1851Ай бұрын
js part is not working
@farhanalikhan2912 Жыл бұрын
::-webkit-calender-picker-indicator not working can somebody help?
@AstroPlus_6 ай бұрын
Type it manually
@sheikhrasel854 Жыл бұрын
Wow! ❤❤❤
@komal89172 ай бұрын
My code is not working..in console result is showing 0 0 0
@kimayagupta89822 ай бұрын
you might have added birthDate values for d2, m2, y2. I also did it by mistake. Assign these values : let d2 = today.getDate(); let m2 = today.getMonth() + 1; let y2 = today.getFullYear();
@tahashahid4186 Жыл бұрын
bro JavaScript code is not working you must need to see.
@baqigamer09 ай бұрын
It's working bro
@webninjadev11 ай бұрын
it is not working properly
@Z_Rokhri Жыл бұрын
My calculate button isn't working, bro
@Epic_stickman90 Жыл бұрын
Check if you spelled the name on the onclick right & make sure you have () in front of it
@zirconia1205 Жыл бұрын
For me, it was undefined. My problem was the Let result = .document.getElementById After I erase the . In '.document', it worked.
@josefigarola5402 Жыл бұрын
i had to add userInput.addEventListener("input", calculateAge); at the end of my js file
@tonsomar-coder Жыл бұрын
Wanna Collab? 💙
@RohitSingh-yw7rg Жыл бұрын
-webkit-calendar-picker-indicator not working
@MyGamingEra Жыл бұрын
Same bro
@lautaroalegria1427 Жыл бұрын
@@MyGamingEra because you are using it on firefox, it only support in chrome
@RohitSingh-yw7rg Жыл бұрын
@@lautaroalegria1427 Yes
@aryaganguly632 Жыл бұрын
Chrome me bhi nahi horaha
@iamankusingh Жыл бұрын
❤❤
@mohi7109 Жыл бұрын
Can somebody explain to me this part of the line below: ....} else { m3--; d3 = getDaysInMonth(y1, m1) + d2 - d1; } if (m3 < 0) { m3 = 11; y3--; } function getDaysInMonth(year, month) { return new Date(year, month, 0).getDate(); }
@17-4-4 Жыл бұрын
pls explain
@sushantlimbu4953 Жыл бұрын
atleast give sourse code
@mohsin_maqbool Жыл бұрын
This is not mobile-responsive
@anjalikhare22979 ай бұрын
Code not working
@surafelfikadu4331Ай бұрын
... 💚💛❤🙏
@YashGuruModsoffical Жыл бұрын
Bhai kis chij ki jaldi h tujhe itni jaldi jaldi type kr leta h fir smjhane Beth jata h ,aur tujhe samjhana bi to nhi ata dhang se , agr koi Banda tere channel pr kuch sikhne aa rha h iska mtlb usko jaldi nhi h kisi chij ki vo aram se time nikal kr Sikh rha h kam se kam fast to Mt kr video ko , smjhana to ata nhi tujhe to dheere dheere hi likh bol bol kr taki hm khud se smjh ske .
@Kim-d2u Жыл бұрын
24 oct 23
@Kim-d2u Жыл бұрын
11 nov 23
@satyamverma82866 ай бұрын
i don't like your videos i am having lot of issue in date picker option you should explain more
@anjinethmi64595 ай бұрын
It's working. Try calc(100%) instead of calc(100% - 10px). Not related to time object. This is the where only that I get an error