Input date and time in HTML and Javascript || (flatpickr.js)

  Рет қаралды 110,944

RavenJS

RavenJS

Күн бұрын

Пікірлер: 104
@JorgeMorua-f3s
@JorgeMorua-f3s 21 күн бұрын
dude, i have been researching for almost 3 hrs, saved my life!!
@anithasshenoy6662
@anithasshenoy6662 2 жыл бұрын
This is far better than Bootstrap-datepicker. With bootstrap-datepicker , width of the control was very huge and some how I could not bring it to desired size. This is cute. Thank you so much. I had tried it yesterday, but didn't know how to initialize it. You made it simple. Thanks a lot.
@Kareszrk
@Kareszrk 2 жыл бұрын
Thank you so much dude! I love it! My client was ordering me this thing and I literally found no info only your video! Thank you!
@anishsahani1824
@anishsahani1824 3 жыл бұрын
Thank you so much... I had wasted more than 10 hours before coming to your video. This solved my problem... You saved my day :)
@ravenjs
@ravenjs 3 жыл бұрын
I'm so glad haaha xD
@mi5956
@mi5956 3 жыл бұрын
Thanks man, Flatpickr is horrible on explaining where to use config option, their documentation wasted 4 hours. but you explained it very well. thanks brother
@ravenjs
@ravenjs 3 жыл бұрын
haha, yea you're not wrong :)
@Toro-Tor
@Toro-Tor 2 жыл бұрын
Uhh man, THANK YOU for the great tip, this "thing" is fantastic !!! I've configured a Date &Timepicker just the way I wanted it. I will insert the css locally and style the colors a bit different - Now the next stage is to send this to an email
@vagabondideas9685
@vagabondideas9685 Жыл бұрын
Dud, You Rock! Thanks for sharing this!👍👍
@razvandragusin6634
@razvandragusin6634 Жыл бұрын
Thanks for sharing with us this amazing information! Keep it up :)
@Bersek-ups
@Bersek-ups 11 ай бұрын
Really thx, this save me, i really need it a datetime picker for firefox and this work, REALLY THX, u are a great person
@aV5d9nlUBQ9
@aV5d9nlUBQ9 6 ай бұрын
Proved to be useful. Thanks!
@movacthuz
@movacthuz 2 жыл бұрын
man, i've been searching for this as well.. thanks a lot!
@marcushagerstrand8689
@marcushagerstrand8689 3 жыл бұрын
Thank you so much! I almost gave up searching for this solution 😅
@ravenjs
@ravenjs 2 жыл бұрын
hahaha
@prabhchahal4492
@prabhchahal4492 3 жыл бұрын
Cant thank you enough. That was extremely helpful
@ravenjs
@ravenjs 3 жыл бұрын
thank you :)))
@stepsexpert8432
@stepsexpert8432 2 жыл бұрын
Great help Thanks a lot Dear! You saved me time
@randeepyasintha140
@randeepyasintha140 Жыл бұрын
Keep up the good work ma8.
@zukurinshi
@zukurinshi Жыл бұрын
Thanks for this tutorial really helped!
@tuantran4377
@tuantran4377 2 жыл бұрын
Does it have to work with bootstrap? I did exactly the same every step and it does not work. It only shows the regular datetime-local
@ravenjs
@ravenjs 2 жыл бұрын
No, it should work even with plain JS and CSS
@DarkLightBoy
@DarkLightBoy Жыл бұрын
did you find a fix for it, i have the same issue
@AlexandraIevtushenko
@AlexandraIevtushenko 2 жыл бұрын
God bless you, dude!
@iuriius
@iuriius 2 жыл бұрын
thanks for this nice tutorial 🙏
@sheriffcrandy
@sheriffcrandy 2 жыл бұрын
Man this is so dope man. Thank you bro! How can I extract each field for processing? I need to get the month, day and year as separate fields.
@TalhaAkhtar.Official
@TalhaAkhtar.Official Жыл бұрын
Thanks bro this really helps alot
@S-Lomar
@S-Lomar Жыл бұрын
Tahnk you for sharing ❤️💕♥️❤️♥️♥️💓❤️❤️❤️❤️💓💕💞💓💕
@CorlStream
@CorlStream 2 жыл бұрын
Thanks for this video! It helped me a lot!
@muttBunch
@muttBunch Жыл бұрын
This is an amazing find. Thank you. I’m using the mdbootstrap library and it’s a huge mess. It doesn’t work correctly and you cannot get the value of the datetime input change.
@codingSparrow143
@codingSparrow143 3 ай бұрын
@RavenJS Hey!! This looks like a very good solution😊. But is there any way to have different time intervals for time? Like I want to have an half-hour difference between two times. e.g. 10:30, 11:00, 11:30..... and so on.
@carlotadias9335
@carlotadias9335 2 жыл бұрын
I am trying to implement it in an angular project, but it doesn't recognize flatpickr("#myID", {}); even after putting the script as you did. it seems it asks for the npm install which I cannot do in this point (problems with lerna). do you know the alternative to import it without doing the npm install?
@ravenjs
@ravenjs 2 жыл бұрын
yes you could just include the script tag in the html without having to touch npm like you would with a plain JavaScript module. You can find the copyable script tag in the flatpickr docs
@carlotadias9335
@carlotadias9335 2 жыл бұрын
@@ravenjs thank you
@pizzapanni
@pizzapanni 2 жыл бұрын
My flatpickr looks ulgy like it's the browser default. How did you get yours to look so good?
@ravenjs
@ravenjs 2 жыл бұрын
did you include the css when importing flatpickr?
@pizzapanni
@pizzapanni 2 жыл бұрын
Just noticed this comment after you've hearted it, i fixed the issue. It was using the default picker and not flatpickr.
@ladiran
@ladiran 2 жыл бұрын
@@pizzapanni I have same issue! Please, how could I stop it from using the default time picker? I am using chrome browser. Thanks
@pizzapanni
@pizzapanni 2 жыл бұрын
@@ladiran Sorry man, I wish I could help you though. It was so long ago that I don't even remember how I solved it. Hope you find a way!
@ladiran
@ladiran 2 жыл бұрын
@@pizzapanni Thanks, all the same🙏
@mindiaarabuli9426
@mindiaarabuli9426 2 жыл бұрын
When I have open Inspect Element and refreshing page , The code no longer works :/
@bikramshrestha2196
@bikramshrestha2196 Жыл бұрын
Also, is there a way to get the output date time in ISO:8601 format like 2023-07-28T09:30+00. currently it is showing as 2023-07-28 09:30 and one of the APIs i am using takes input in iso 8601 format
@AnaDrawzone
@AnaDrawzone 2 жыл бұрын
Hello there! Do you know if this has dates avalibles in spanish??
@ravenjs
@ravenjs 2 жыл бұрын
Yes, I believe they are available in Spanish as well flatpickr.js.org/localization/
@DanielJoshua-ck3ui
@DanielJoshua-ck3ui 7 ай бұрын
Is it responsive for Al screen?
@ghaithguesmi5857
@ghaithguesmi5857 2 жыл бұрын
thank you brooo thank you very much
@Kieselsteo
@Kieselsteo 5 күн бұрын
Yo bro do you have any idea why its all messed up in the chrome browser. Its great but I cant change the year and I can only change the month forward because the arrows are on the same spot
@anjon-roy
@anjon-roy 3 жыл бұрын
Thanks for the help. but I have a question I want to set a button when the user clicks on the button the calendar will show. is it possible?
@ravenjs
@ravenjs 3 жыл бұрын
Yes @Anjon Roy it is totally possible. See this section of the documentation where they've already given us a working example: flatpickr.js.org/examples/#flatpickr--external-elements
@anjon-roy
@anjon-roy 3 жыл бұрын
@@ravenjs thank you so much
@ravenjs
@ravenjs 3 жыл бұрын
​@@_shienister_ I did some debugging for you and here's what I found: Everything works until this part: formatDate: (date, format, locale) => { // locale can also be used return moment(date).format(format); } It means that you formatDate option dateConfig is faulty, you might wanna check your momentJS implementation. You'll also find that everything else works if you just comment this section out. Do let me know if this solved your issue.
@anithasshenoy6662
@anithasshenoy6662 2 жыл бұрын
@Logicism, I used flatpicker and it is very good. However I am stuck with a serious issue. I am using mySql qith django to output data from database to html page. When retrieving date data, flatpicker only shows the year correctly. date and month defaults to january 1st. I found that MySql is outputing the data as (month. date, year) instead of standard month-date-year. This is messing with the actual display. I assume flatpicker is not able to read the mySql output correctly. Is there any way to correct this ? @UCLyyqt2S4Ydc47W7Hiw3x0w
@ravenjs
@ravenjs 2 жыл бұрын
yes it shouldn't be too hard a problem to solve. have you tried using any date parsers? Maybe something like Date.parse() developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse
@anithasshenoy6662
@anithasshenoy6662 2 жыл бұрын
@@ravenjs Thanks for the idea. However it didn't work. But I made another code that works. Here it is $(function(){ let edate =new Date("{{ displayshop.entry_date }}") ; var newdt = edate.getFullYear() + "-" + (edate.getMonth() +1 ) + "-" + edate.getDate() ; document.getElementById("entry_date").value=newdt ; flatpickr("#entry_date", {dateFormat: "Y-m-d"}); });
@sulmedici
@sulmedici Жыл бұрын
Sir can we use it to pick multiple dates?
@alexandergdansk
@alexandergdansk 2 жыл бұрын
Good job!
@Asaduzzaman2189
@Asaduzzaman2189 3 жыл бұрын
Thank you so, so much. Very helpful.
@ravenjs
@ravenjs 3 жыл бұрын
you're most welcme 😎
@bikramshrestha2196
@bikramshrestha2196 Жыл бұрын
Is there a way to add hour to the time you set in the picker?
@michcalu
@michcalu 2 жыл бұрын
That is a nice explanation, thanks. But do you know how to make it work when you have nested forms on the fly? When I add a form with a date input, fllapickr is inactive until I submit the form with new data in the new fields.
@MarkVoVN
@MarkVoVN 3 жыл бұрын
thanks dude, really helped me alot
@ravenjs
@ravenjs 3 жыл бұрын
you're most welcome
@suri5023
@suri5023 3 жыл бұрын
very helpful. thank you so much
@ravenjs
@ravenjs 3 жыл бұрын
I'm so glad it was helpful Soroush :)))
@nassimbendjillali3714
@nassimbendjillali3714 3 жыл бұрын
thank you so much sir this is what i need
@ravenjs
@ravenjs 3 жыл бұрын
glad it helped :))
@blairmottau
@blairmottau 3 жыл бұрын
thanks for the vid! super helpful :)
@ravenjs
@ravenjs 3 жыл бұрын
thank you too @Blair :)))
@renantibia92
@renantibia92 Жыл бұрын
Congratulations on the video, it's a great way to customize the input date. I just wanted to know how I can change the language, is it possible?
@ryanhernandez8388
@ryanhernandez8388 2 жыл бұрын
helped a lot man thanks!!
@temporari2606
@temporari2606 2 жыл бұрын
bro can u make a add new table row ------> and flatpickr still working in (input type="date")
@electroe2143
@electroe2143 3 жыл бұрын
Thank you so much for sharing this.
@ravenjs
@ravenjs 3 жыл бұрын
you're most welcome @Electro :))
@franciscodisanzo6816
@franciscodisanzo6816 3 жыл бұрын
Hi, thank you!! Just what I needed. Do you know if I can change the calendar language?
@ravenjs
@ravenjs 3 жыл бұрын
hi Francisco, sorry for the late reply! To change the language, you can add a property to the config object like so: config = { "locale": "ru" // locale for this instance only } The timestamp for when I'm making the config object: 3:33 Configuration Object You can find more details here: flatpickr.js.org/localization/
@franciscodisanzo6816
@franciscodisanzo6816 3 жыл бұрын
@@ravenjs hi, Thank you very much!! Thanks for replying!
@ravenjs
@ravenjs 3 жыл бұрын
@@franciscodisanzo6816 you're welcome :)
@mohdzulfadhli
@mohdzulfadhli 2 жыл бұрын
can i make it to only shows year?
@ravenjs
@ravenjs 2 жыл бұрын
Yep you definitely can. Use the formatting tokens from flatpickr: flatpickr.js.org/formatting/
@mohdzulfadhli
@mohdzulfadhli 2 жыл бұрын
@@ravenjs thanks but I mean pick only year without day and month. is it possible?
@labeebmahir
@labeebmahir 3 жыл бұрын
Thank You. It was helpful
@ravenjs
@ravenjs 3 жыл бұрын
Glad it helped @Laheeb
@Lucas-gg9yb
@Lucas-gg9yb Жыл бұрын
Can i have it fixed in the page layout instead of showing it only when i click in the input?
@furqonqolbi
@furqonqolbi Жыл бұрын
thank you
@srikarpuligilla5724
@srikarpuligilla5724 Жыл бұрын
how can use it in angular.........is it possible.
@lucasbrantes1
@lucasbrantes1 Жыл бұрын
i`am receiving this erros if-modal.js:24 There was a problem with the fetch operation: ReferenceError: flatpickr is not defined at showModal (otif-modal.js:45:5) at otif-modal.js:21:17 (
@fauzanganinurmaizal8958
@fauzanganinurmaizal8958 2 жыл бұрын
thanks man its work
@gloriarolan7807
@gloriarolan7807 3 жыл бұрын
How to limit the date ?
@ravenjs
@ravenjs 3 жыл бұрын
You can use the minDate/maxDate properties in the configObject: flatpickr.js.org/examples/#mindate-and-maxdate Or, you can use the disable array property: flatpickr.js.org/examples/#disabling-dates
@paulopaulo1615
@paulopaulo1615 3 жыл бұрын
Apprecitaed! Subs
@ravenjs
@ravenjs 3 жыл бұрын
thanks Paulo :)))
@cristobaldelapiedra
@cristobaldelapiedra 3 жыл бұрын
thank you very much
@ravenjs
@ravenjs 3 жыл бұрын
glad it helped :)
@flexairz
@flexairz 2 жыл бұрын
Implementing this into a project and time was not selectable anymore.. did not work.
@excelshorts5797
@excelshorts5797 11 ай бұрын
How to disable previous date, cursor: not-allowed for previous date
@morse19792
@morse19792 Жыл бұрын
Genial!
@carlosvesta
@carlosvesta 3 жыл бұрын
Muito obrigado.
@ravenjs
@ravenjs 3 жыл бұрын
de nada @Carlos Vesta
@AbdullahKhan-fq5pp
@AbdullahKhan-fq5pp 3 жыл бұрын
please share datetimepicker code with type text not date
@ravenjs
@ravenjs 3 жыл бұрын
do you mean a text input field?
@LowProfie_
@LowProfie_ Жыл бұрын
Mine is not working😢
@TheLKStar
@TheLKStar 12 күн бұрын
This is 99% of the way there. Manual inputs get autocorrected when badly formatted dates are inputted, that's a really bad decision since the user may not notice a wrong date. Could not change this.
@dotel6560
@dotel6560 2 жыл бұрын
you madman
@clryung6425
@clryung6425 2 жыл бұрын
Thank you so much
Subtle, yet Beautiful Scroll Animations
5:04
Beyond Fireship
Рет қаралды 1,8 МЛН
It works #beatbox #tiktok
00:34
BeatboxJCOP
Рет қаралды 41 МЛН
She made herself an ear of corn from his marmalade candies🌽🌽🌽
00:38
Valja & Maxim Family
Рет қаралды 18 МЛН
Cat mode and a glass of water #family #humor #fun
00:22
Kotiki_Z
Рет қаралды 42 МЛН
How to add datetimepicker using bootstrap
6:45
Frontend Paathshala
Рет қаралды 66 М.
How to add Datepicker in Bootstrap 4 and 5
6:12
Frontend Paathshala
Рет қаралды 93 М.
Custom Input Date | Styling Input Date | Pure CSS Tutorial
5:09
Coding Artist
Рет қаралды 79 М.
Learn DOM Manipulation In 18 Minutes
18:37
Web Dev Simplified
Рет қаралды 1 МЛН
It works #beatbox #tiktok
00:34
BeatboxJCOP
Рет қаралды 41 МЛН