-
Notifications
You must be signed in to change notification settings - Fork 6.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(datepicker): add support for choosing time #5648
Comments
This comment has been minimized.
This comment has been minimized.
If there is no estimation on when this might become available, can anyone recommend a date/timepicker to use in the meanwhile? |
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. |
Ah cheers for the heads up. I'll do that. Seems so obvious I'm not sure why I didn't think of it. :) |
This comment has been minimized.
This comment has been minimized.
I found this possible temporary implementation (until an official version is released): |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Im currently using https://github.com/vlio20/angular-datepicker |
I have just created a repository to give users ability to choose time, based on material 5 and mat-dialog. https://owsolutions.github.io/angular-material-clock-time-picker/ Is there any specific way to merge this repository into material itself? |
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 |
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. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
We have the implemented a fully working version now. All bugs are fixed, and working fine with angular 5 material. Please check these before: |
@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.. |
We did that: https://www.youtube.com/watch?v=ZSM_GxfFahg |
@matheo Wow great! Is there any way I can use this too in my project? |
@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). |
This example is more complete:
The result of
This seems to be the only way to keep up with Angular version updates right now. |
Not a big fan of using a thirdparty lib for this though; i would probably use something like a smaller function to transfer back and forth :) |
Related: |
02/27/2024 :') |
I think I'm gonna apply for Google's jobs just to develop this xDD |
03/27/2024 :') |
This is a p5 priority requirement and after 7 years no progress has been made. Maybe the angular team never chose the time scenario 😀 |
This component is a part of the Material design. And this is the official Material implementation for Angular by Google. Weird that other frameworks have already implemented it, except the one that defined the specifications. Just a fact or observation. I would be satisfied with a number input for the time if the implementation of the graphic clock circle is too complex. This can be a part of the date picker. Supporting located time (12/24h). I'm wondering why no member of the Angular team is commenting on this highly rated issue. I doubt a PR will be accepted, won't it? Here are some links that might be helpful:
The analog clock circle looks interessting, but should not be a blocker for the implementation of a time picker. For me a simple input like this (gif above) would satisfy the request. |
@fudom One main concern i have with the time picker is, that not every part is accessible to all users, there are many libraries (including the ones you posted) and most of them dont even consider accessibility. M2 and M3 were initially, afaik, only designed to be compatible with mobile devices, hence why most of the designs only depict mobile screens. Now scaling them up or adapting them to desktop devices comes with the challange, of supporting technologies like screen readers and figuring out when they're active and when to activate a dial face or a input face on the timepicker. I think there are still things that need to be put into consideration for everything to work. |
I just crafted a rough simple prototype. Not yet ready to use. Only for demo / inspiration / workaround. |
@fudom See: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/datetime-local this is already a native implementation of your approach, i think it would be easier to adjust the styles (if any need to be made) on it. |
@luii - you mean like this? https://mui.com/x/react-date-pickers/date-time-picker/ |
@luii The native input is no option for several reasons. Styling doesn't work well everywhere. Especially native popovers. And it looks and behaves different on every browser. For example, in Firefox I don't see the time picker. Therefore I wanted to craft a component using the existing framework without dependencies or experiments (gamble). I could just use the native input. But mixing UI frameworks looks ugly and amateurish. The developer has no control over the functionality of the app and the user interface.
Good luck to style this to match the Material Design. :D It's definitely not easier. It's impossible. |
Coming from the deprecated https://github.com/IliaIdakiev/angular-material-timepicker I landed here hoping for a mature solution. Most of the 3rd parties out there keep the value type "string" so I'd need to heavily adopt my projects. Since the timepicker even is part of Google's Materia Design and the MDC-based components are pretty close to it, would it really take that much effort to please the community with this component? P5 feels so sad ... |
Not sure if it was mentioned before between all third party solutions but my current company uses this one: https://ng-matero.github.io/extensions/components/datetimepicker/overview https://github.com/ng-matero/extensions?tab=readme-ov-file However some specific usecase has a need for setting timezone on a datetime picker, we are not using the local system's timezone or utc time. But very specific timezone. So we created a wrapper around this which interacts with the adapter for Until a solution from the angular team which which does not seem to be a priority, I suggest look at the solutions that are posted or create your own.. |
Yeah, that one actually seamed to be the most mature for now. Was already thinking about it, thank you for mentioning again! :) |
can we get this feature, please? bit ridiculous this issue was opened 7 years ago. is it that much of a hassle? |
Really need this feature! Please, provide us this solution. The community is tired of solutions that are not working in some of the ways. I thought I found a good one, but unfortunately it's not working well with MAT_DATE_LOCALE: 'no'. https://ng-matero.github.io/extensions/components/datetimepicker |
I'd love to know if this was truly |
This is amazing work @dhutaryan. Thank you for coding this. I think Angular Material team should integrate your work. Are you also thinking about [mat-datetimepicker]? |
@mseltene awesome! Looks like very good alternative. |
Hi, @airtonferreira. Thank you. I just want to clarify @dhutaryan is the awesome maker of this. |
@mseltene oh, I'm sorry. I got confused. Congrats @dhutaryan |
@mseltene @airtonferreira thank you guys. Do my best 🙂 |
Should be able to choose, just date, just time, or date & time
The text was updated successfully, but these errors were encountered: