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.

Комментарии • 64

  •  2 года назад +3

    Thank you, my friend.
    I don't understand your language, but i understood your code

    • @Asteducation
      @Asteducation  2 года назад

      Thanks and for sure we will try to provide sub titles now onwards.

  • @techcollege3762
    @techcollege3762 2 месяца назад +1

    Thank you very much you exit me where I stucked

  • @pmjavier02
    @pmjavier02 Год назад +1

    Thanks, it was a great help

  • @quickclipsbysnoopy
    @quickclipsbysnoopy 2 года назад +5

    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

    • @parthib77
      @parthib77 2 месяца назад

      thanks man!! .........really I was thinking y the code is not working

  • @simrangupta1256
    @simrangupta1256 Год назад +1

    I want to set the default date 60 days back from the current date. What should I do?

    • @Asteducation
      @Asteducation  Год назад

      // 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));

    • @Asteducation
      @Asteducation  Год назад

      For more you can connect via insta ajay_ast

    • @simrangupta1256
      @simrangupta1256 Год назад +1

      @@Asteducation It worked. Thanks a lot.

    • @Asteducation
      @Asteducation  Год назад

      @@simrangupta1256 Anytime

    • @simrangupta1256
      @simrangupta1256 Год назад +1

      @@Asteducation can we anyhow disable future dates?

  • @adityapagare362
    @adityapagare362 Месяц назад

    How to set by default current month from the month input?

  • @nadahefny3655
    @nadahefny3655 2 месяца назад +1

    How can i set value for a month

    • @Asteducation
      @Asteducation  2 месяца назад

      @@nadahefny3655 just set the month

  • @khristeljaneculi2480
    @khristeljaneculi2480 2 года назад +1

    How to get date from database, then add 6months to that date?

  • @Milan-ef5qr
    @Milan-ef5qr Год назад

    Not able to browse ur Blog

  • @quangnghia7211
    @quangnghia7211 3 года назад +1

    thks man. that's very helpful

  • @lucascaceres3505
    @lucascaceres3505 3 года назад +2

    Muy buen video! Gracias!!!

  • @abhimanyupagade4289
    @abhimanyupagade4289 Год назад

    How can we enable copy paste in date picker.

  • @gouthamharshith2399
    @gouthamharshith2399 2 года назад +1

    How do I get the a date which is 5 days before current date?

    • @Asteducation
      @Asteducation  2 года назад

      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

  • @rex.aditya
    @rex.aditya Год назад +1

    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

    • @Asteducation
      @Asteducation  Год назад

      Text form ka sample kya rakhna hai like 120122 13/01/22, 13012022, 13/01/2022, 13-01-22, 13-01-2022

    • @rex.aditya
      @rex.aditya Год назад

      @@Asteducation 13-10-2022

  • @komarrujaman2337
    @komarrujaman2337 Год назад

    it works if input type text but when i change to type date the date didn't show again.

  • @lakshitha_sandamal
    @lakshitha_sandamal 3 года назад +1

    thanks !

  • @sweetyprasad287
    @sweetyprasad287 2 года назад +1

    Thank you so much 💜

  • @bgmiwicked6053
    @bgmiwicked6053 3 года назад +2

    How to input only a future date and not a past one

  • @shrawankumar5300
    @shrawankumar5300 3 года назад +1

    Bro i scripted js same as you in html but not working,help me out

    • @Asteducation
      @Asteducation  3 года назад +1

      Send me the code image on insta @asteducation.co

    • @shrawankumar5300
      @shrawankumar5300 3 года назад +1

      @@Asteducation sent bro...please check out

    • @Asteducation
      @Asteducation  3 года назад +1

      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.

    • @Asteducation
      @Asteducation  3 года назад

      Yup added + 1 as well

  • @aayushisolanki247
    @aayushisolanki247 3 года назад +1

    How to get selected date from calendar in a variable?

    • @Asteducation
      @Asteducation  3 года назад

      let date = document.getElementById(idname).value

    • @aayushisolanki247
      @aayushisolanki247 3 года назад +1

      @@Asteducation nothing is coming with this

    • @Asteducation
      @Asteducation  3 года назад

      @@aayushisolanki247 send me the screenshot of your code on Instagram. @asteducation.co

    • @aayushisolanki247
      @aayushisolanki247 3 года назад +1

      @@Asteducation done

    • @Asteducation
      @Asteducation  3 года назад

      @@aayushisolanki247 didn't receive yet !

  • @varshadubey1405
    @varshadubey1405 3 года назад +1

    Sir aapke channel par pura course mil jayega html Ka?

  • @abdelrhman2154
    @abdelrhman2154 2 года назад

    Not working for me in HTML

  • @ashishprajapati47
    @ashishprajapati47 3 года назад +1

    bro angular mai kaise krege????????

  • @fahadanncode1984
    @fahadanncode1984 2 года назад

    input type should be text

  • @lucasa8710
    @lucasa8710 4 года назад +1

    parece que eu to escutando um áudio ao contrário

    • @Asteducation
      @Asteducation  4 года назад +1

      desculpe cara, isso está em idioma hindi

    • @Asteducation
      @Asteducation  4 года назад

      mas você pode seguir o vídeo ou blog cujo link está na descrição

    • @lucasa8710
      @lucasa8710 4 года назад +2

      @@Asteducation I understood the video, but it was funny to me and i left a comment

    • @hugorios8872
      @hugorios8872 3 года назад +2

      @@lucasa8710 kkkkkkkkkkkkkkkkkkkkkk

  • @abdellahmath4574
    @abdellahmath4574 2 года назад

    don't work !!

  • @jbsuperman5630
    @jbsuperman5630 3 года назад +1

    ☹️