components icon indicating copy to clipboard operation
components copied to clipboard

feat(datepicker): add support for choosing time

Open mmalerba opened this issue 8 years ago • 232 comments

Should be able to choose, just date, just time, or date & time

mmalerba avatar Jul 10 '17 17:07 mmalerba

@mmalerba any time frame on this?

fxck avatar Jul 23 '17 08:07 fxck

If there is no estimation on when this might become available, can anyone recommend a date/timepicker to use in the meanwhile?

hawthorner avatar Jul 24 '17 10:07 hawthorner

We're probably not going to have time to work on this until 2018. One possibility in the mean time is to use the datepicker for the date component and a select box or group of select boxes for the time component.

mmalerba avatar Jul 24 '17 16:07 mmalerba

Ah cheers for the heads up. I'll do that. Seems so obvious I'm not sure why I didn't think of it. :)

hawthorner avatar Jul 24 '17 18:07 hawthorner

@mmalerba time-picker is not even on the plan list. No affense, but it seems to almost half a year to when it comes up. What's your team's major work for now?

e-cloud avatar Jul 25 '17 00:07 e-cloud

I found this possible temporary implementation (until an official version is released):

  • http://code.promactinfo.com/md2/#/datepicker
  • https://github.com/Promact/md2/tree/master/src/lib/datepicker

vwchu avatar Aug 05 '17 05:08 vwchu

@vwchu does it works with angular v4 now ?

sonnh58 avatar Aug 09 '17 04:08 sonnh58

@sonnh58 I haven't used the md2 package in my latest projects recently, but from a quick glance at the Issue tracking, I believe it does.

vwchu avatar Aug 09 '17 17:08 vwchu

@sonnh58 yes it work on angular v4.

ChenReuven avatar Aug 13 '17 09:08 ChenReuven

Im currently using https://github.com/vlio20/angular-datepicker at the moment. I really wish team can get this down ASAP. Reason being I really dont like the clock lol

WaterBleu avatar Sep 05 '17 23:09 WaterBleu

I have just created a repository to give users ability to choose time, based on material 5 and mat-dialog. Here you can see:

https://owsolutions.github.io/angular-material-clock-time-picker/ https://github.com/owsolutions/angular-material-clock-time-picker

Is there any specific way to merge this repository into material itself?

torabian avatar Dec 01 '17 23:12 torabian

I've built a complete DatePicker with time selection forking the official module, but got no answer from @crisbeto on LinkedIn to know how to contribute it

matheo avatar Dec 02 '17 22:12 matheo

They won't accept contribution on this. Big changes like this need to have a design doc first and need to follow the official material design guideline (and the version that is currently publicly available doesn't even have datetimepicker for desktops). Just release it as a third party component.

fxck avatar Dec 03 '17 06:12 fxck

I had to do my own plan and I've followed the official material design (https://material.io/guidelines/components/pickers.html) perhaps I had to implement it on the modal only. Currently I don't have too much time to publish it but I will try to.

matheo avatar Dec 03 '17 07:12 matheo

Those guidelines you linked are for phones / old revision.

fxck avatar Dec 03 '17 08:12 fxck

We have the implemented a fully working version now. All bugs are fixed, and working fine with angular 5 material. Please check these before: https://owsolutions.github.io/angular-material-clock-time-picker/ https://github.com/owsolutions/angular-material-clock-time-picker

torabian avatar Dec 04 '17 18:12 torabian

@torabian this issue is about integration of a timepicker into the datepicker, so you can choose date and time in the same input / model, rather than having to manually join them after the fact..

fxck avatar Dec 04 '17 19:12 fxck

We did that: https://www.youtube.com/watch?v=ZSM_GxfFahg It 's not perfect but does the job quite nicely, it took some time to get it working and move on to the next task.

matheo avatar Dec 05 '17 01:12 matheo

@matheo Wow great! Is there any way I can use this too in my project?

chrisonline avatar Dec 05 '17 08:12 chrisonline

@matheo yea, but then again, there components like that already http://code.promactinfo.com/md2/#/datepicker (change Picker Type to date time) and they have the same problem as yours will likely have, and that is duplicating / forking datepicker functionality, since it's not quite reusable / extendable (especially the input part).

fxck avatar Dec 05 '17 13:12 fxck

image

I created my own version by forking material datepicker as well so I know what I'm talking about, it's not easy to keep up with changes of datepicker / overlay services.. it's simply a huge pain in the ass and I wish they would work on the official version soon.

fxck avatar Dec 05 '17 13:12 fxck

@fxck Indeed, my fork is almost two months old (pre-5.0) and it's a pain to think about syncing it to the latest code. It would be nice to have a word from @crisbeto to figure a solution that benefit all of us. My code is clean and it would be good to try to merge it into the official module.

matheo avatar Dec 05 '17 16:12 matheo

I took the Promact Md2/Datepicker and refactored it to depend on material. Added theming support and a native/moment adapter which mostly delegate to the existing material date-adapters except for time functions. It is not published but you can test it out locally or publish it to your private NPM registry. The latest commit is based on 5.0.0-rc.3.

https://github.com/kuhnroyal/mat-datetimepicker

kuhnroyal avatar Dec 06 '17 14:12 kuhnroyal

@kuhnroyal Wow great. I will wait once you have published it ;-)

chrisonline avatar Dec 06 '17 14:12 chrisonline

@chrisonline I just published it on the npm registry.

kuhnroyal avatar Dec 14 '17 14:12 kuhnroyal

@kuhnroyal Great, thank you very much!

chrisonline avatar Dec 14 '17 16:12 chrisonline

+1 for an official datetime picker, we'll check out @kuhnroyal in the meantime.

EricPSU avatar Dec 14 '17 17:12 EricPSU

Anyone have it bundled successfully with webpack with @kuhnroyal time picker?

dannyhchan avatar Dec 14 '17 21:12 dannyhchan

@dannyhchan I am using this productive with webpack and AOT. Do you have any issues?

kuhnroyal avatar Dec 15 '17 01:12 kuhnroyal

@kuhnroyal , I just got it working with webpack. I was missing the @angular/material-moment-adapter which was causing the issue. Great work by the way.

dannyhchan avatar Dec 15 '17 01:12 dannyhchan