How to set value dynamically in input type date in html | set value in calendar | ast education
HTML-код
- Опубликовано: 27 окт 2024
- #html #javascript
Hello everyone,
what is this video about = after watching this video you will be able to set the value dynamically in input type date in html | calendar of html.
==================================================
If you are reading this then please give you precious time to comment your feedback that is what which motivate us to make such videos.
==================================================
blog link = www.astblogs.c...
/ asteducation.co
www.twiter.com...
/ asteducation.co
www.astblogs.com
asteducation.co@gmail.com
*********************************************************
if you like this video please do subscribe
Thanks for Watching , Have a good one.
Thank you, my friend.
I don't understand your language, but i understood your code
Thanks and for sure we will try to provide sub titles now onwards.
Thank you very much you exit me where I stucked
Thanks, it was a great help
var date = new Date();
var year = date.getFullYear();
var month = String(date.getMonth()+1).padStart(2,'0');
var todayDate = String(date.getDate()).padStart(2,'0');
var datePattern = year + '-' + month + '-' + todayDate;
document.getElementById("date-picker").value = datePattern;
for those who are trying in jan to sept, you code will not work. This one will work
thanks man!! .........really I was thinking y the code is not working
I want to set the default date 60 days back from the current date. What should I do?
// Get the current date
var currentDate = new Date();
// Subtract 60 days
var minus60Days = new Date();
minus60Days.setDate(currentDate.getDate() - 60);
// Print the new date in ISO format (YYYY-MM-DD)
console.log(minus60Days.toISOString().slice(0, 10));
For more you can connect via insta ajay_ast
@@Asteducation It worked. Thanks a lot.
@@simrangupta1256 Anytime
@@Asteducation can we anyhow disable future dates?
How to set by default current month from the month input?
How can i set value for a month
@@nadahefny3655 just set the month
How to get date from database, then add 6months to that date?
Which db you are using ?
Not able to browse ur Blog
thks man. that's very helpful
Muy buen video! Gracias!!!
How can we enable copy paste in date picker.
How do I get the a date which is 5 days before current date?
Just do this first set the date to 5 days back
var d = new Date();
d.setDate(d.getDate() - 5);
Then continue with our code
Date mask ko hatana hai.. aur usme date text form me likhna hai tb kya kare.. aur date mask web site se hatana hai.. jisme ham entry karte hai kyunki date choose karne me irritate lagata hai
Text form ka sample kya rakhna hai like 120122 13/01/22, 13012022, 13/01/2022, 13-01-22, 13-01-2022
@@Asteducation 13-10-2022
it works if input type text but when i change to type date the date didn't show again.
Can you share your code ?
thanks !
Thank you so much 💜
How to input only a future date and not a past one
Will share that.
Bro i scripted js same as you in html but not working,help me out
Send me the code image on insta @asteducation.co
@@Asteducation sent bro...please check out
Yes, i have checked that and got the issue, the issue is you have to add String(date.getMonth()+1).padStart(2,'0'); for month also, because we should get single digit value for month so we have to add 0 as prefix of month value.
Yup added + 1 as well
How to get selected date from calendar in a variable?
let date = document.getElementById(idname).value
@@Asteducation nothing is coming with this
@@aayushisolanki247 send me the screenshot of your code on Instagram. @asteducation.co
@@Asteducation done
@@aayushisolanki247 didn't receive yet !
Sir aapke channel par pura course mil jayega html Ka?
Haan , hum jald hi course start kr rhe hai 1 ya 2 din mai.
@@Asteducation RUclips par?
@@varshadubey1405 haan
@@Asteducation ok
Thankyou sir
Not working for me in HTML
bro angular mai kaise krege????????
input type should be text
parece que eu to escutando um áudio ao contrário
desculpe cara, isso está em idioma hindi
mas você pode seguir o vídeo ou blog cujo link está na descrição
@@Asteducation I understood the video, but it was funny to me and i left a comment
@@lucasa8710 kkkkkkkkkkkkkkkkkkkkkk
don't work !!
☹️
What happened man ?