tempus-dominus icon indicating copy to clipboard operation
tempus-dominus copied to clipboard

State of the picker and Version 6

Open Eonasdan opened this issue 4 years ago • 3 comments

Please read this blog post

There are currently 6 major tasks that will be happening as time allows.

  1. Merge Tempus Dominus Core and Tempus Dominus BS 4 together. This will be the base going forward. The TD projects will be EOL’d and remain untouched. I will probably archive those repos.

  2. Remove Bootstrap. Moving forward, BS won’t be a hard dependency. I’ll use a tool to grab the basic styles to generate a standalone css. The picker’s class names will probably stay the same. Hopefully, things will still look nice with BS5.

  3. Remove jQuery. This is going to be a challenge, as I mentioned during the stream to find all the places where jQuery chains are being used. A LOT of testing is going to need to be done here.

  4. Swap momentjs to dayjs. I realize this will be a difficult hurdle for some to either change or have a second datetime library. I think doing this now will be easier compared to later.

  5. (long term): Font Awesome 6. FA6 is in Alpha at the time of this update so it would be a good idea to prepare the default icons for this. Again, I know some people will still use older versions or Bootstrap Icons, but that’s what the options are for. :)

  6. (long term): Typescript. I started working on a jquery/bootstrap free typescript version a while back but it was a lot of work and never got it working right. I think a typescript version could happen after everything above is completed.

Eonasdan avatar Oct 05 '20 03:10 Eonasdan

Hello, if you haven't already I'd encourage you to read the part 2 blog post. I've c&p the task points below. I'd also suggest you that you join the discord. I'll try to be posting more updates there.

Task1: Repo cleanup. This is done. I've closed all the old issues (sorry if that was one of yours) and I added 2 projects in GitHub for the v6 tasks and the second is for a backlog of items I'd like to do but I'm not sure when those will come about.

Task2: Merging TD. This is also done. I merged together the Tempus Dominus Core and the Bootstrap 4 UI project. I merged a couple of good PRs into the BS4 version as well.

Task3: Remove Bootstrap. Update - I redid the tables to CSS Grid and it looks much better. I could still use someone who is willing to contribute design assistance to either the picker or the docs.

Task4: Remove jQuery. This is done! Man, that was a lot of jQuery my friends. Everything is native now. I'm using the latest JavaScript conventions in the code base. I created a separate file called jQuery.provider.js, so if you still want to do it the jQuery way, include this file along with the main script file.

Task5: Moment to Dayjs. Instead of doing this, I wrote a small date time library that extends the native Date object in javascript. This means there's no external dependency and I only carry around the functions that the picker actually uses. All of the options that previously took a Moment object now accept a Date or my DateTime object. When retrieving selected dates you will get a DateTime object that works just like a Date object.

Task6: FA6. At the time of this writing, FA 6 is still in beta and is only available with a pro subscription. I won't update the defaults until it's released to the public and the free icons are ready to use.

Task7: Typescript. As I was working on removing jQuery I was realizing how much of the code I'd have to rewrite to remove it. Waiting until later would have caused me to have to rewrite the code again in TS, so it just made sense to do it now. The picker's code is now completely in Typescript (except the jQuery plugin code). I'm currently using Rollup to translate this down to JS.

Eonasdan avatar Oct 06 '21 16:10 Eonasdan

Task6: FA6. At the time of this writing, FA 6 is still in beta and is only available with a pro subscription. I won't update the defaults until it's released to the public and the free icons are ready to use.

👋🏼 👋🏼

FA6 has been released :)

I've checked the icons defined at

https://github.com/Eonasdan/tempus-dominus/blob/4cf96112622111c3db16691ec73bae3b04d6dad1/src/js/conts.ts#L19-L27

and they are all available with the same syntax. Demos:

SVG: https://jsfiddle.net/tagliala/bfa6uhse/27/ CSS: http://jsfiddle.net/tagliala/4f8gp2wL/7/

tagliala avatar Feb 27 '22 19:02 tagliala

I have some pending code to make the change

Eonasdan avatar Feb 28 '22 14:02 Eonasdan

It's finally here everyone! Version 6 is out!

The doc have had a make over. You might find some of your bookmarks get redirected to new pages. I split out the Options and Functions docs into more readable pages.

I created a REPL that replaced the example page. This embeds a StackBlitz project and I hope that it will more easily allow for you to view the example html/js. You might notice the hash in the URL when you click on an example. In the future, I will provide a way to "export" any changes you make from the example and the hash will always produce the same code.

My next cycle back to this project (normally in 3 weeks) will likely be focused on doc clean and that kind of thing. After that, I will be trying to fix more bugs and then look at some feature requests.

Thanks for sticking it out with me. The donations I've gotten have definitely made an impact and I thank those of you who have done that.

Eonasdan avatar Aug 16 '22 01:08 Eonasdan

Wow, congratulations! I am just maintaining a project using an old version of the datetimepicker (4.14.30), trying to set a "minimum" date, just read through your blog post, then came across this issue from Oct 2020, scroll down and "It's ready!" from a few hours ago! Way to go! I hope your health keeps getting stronger and you continue to enjoy coding. Rock on!

Edit: Yes! Found it! {minDate: Date.now()}. This old (https://github.com/Eonasdan/tempus-dominus/tree/d62e0ab9c7b9b40a9d530607eae54d2bd3959909 2015!) datetime picker is really amazing, I can't wait to use version 6!

fw-aaron avatar Aug 16 '22 15:08 fw-aaron

@fw-aaron there's a migration tool that should help you. In v6 bootstrap is no longer a dependency so in theory you should be able to use v6 with bootstrap 4/5

Eonasdan avatar Aug 16 '22 17:08 Eonasdan