6 ms·
Show HN: Made my own date picker for AngularJS
- fougerejo 11y agoMissing a link to a demo somewhere on the github page :)
- fougerejo 11y agoOne month ago I tried to find a nice datepicker directive for angular. "tried". Couldn't find one that wasn't broken somewhere. Ended up using the angular-ui one, and spent hours and hours patching the brokeness (options not being taken into account, dates needed to be formatted for the initialisation, etc). That's where I realised that even an active ecosystem as the angular one is not enough to produce quality libraries/modules for basic stuff as a datepicker..
- maaaats 11y agoIt's a bit weird, really. Almost all systems have some dependency on modifying dates and times, yet many big frameworks and languages have completely broken support for it. Both Java and Javascript, which is the languages I know best, have had big issues in the past. One had to use other libraries (Joda and Moment comes to mind), but that again is a problem when other libraries again doesn't use the same libraries for handling dates. Java 8 fixes some of this, and browser support has fixed some of the major ones in JS, but it will take a long time until one can be completely free of the hassle.
- mobinni 11y agoAt my work, even in production we still have to use Joda Time to support proper datetime stamps. Momentjs is pretty much the same for JS at this point. I think my datepicker works pretty well, I just added a demo if you visit the github page at http://mobinni.github.io/material-date-picker/ http://mobinni.github.io/material-date-picker/ you can test it.
- jmkni 11y agoAngularStrap has one which works rather well - https://mgcrea.github.io/angular-strap/#/datepickers https://mgcrea.github.io/angular-strap/#/datepickers
- louhike 11y agoDates are far more complex to manage than most people think. Even though a datepicker is something basic needed on most websites, it seems it needs a lot of effort to create a good one which works everywhere.
- flavj 11y agoLooks good! Have you considered doing a datetime picker too? I have not been able to find one using MD.
- mobinni 11y agoI have thought about it, but I just haven't had the time to implement it, I'll put it on the features list.
- M8 11y agoWhich AngularJS of two? PS: looks nice!
- mobinni 11y agoRight now it works on 1.2.28 and up. Thanks! Much appreciated.
- SchizoDuckie 11y agoIt's a shame that in 2015 we still need to implement datepickers from scratch. Kudo's on your effort :)
- mobinni 11y agoIt really is, thanks!
- velox_io 11y agoI agree, this sort of stuff (especially dialogues in Angular+Bootstrap) is still way too painful. Really hope Angular 2.0 fixes some of this madness.
- atom-morgan 11y agoWhen you say dialogues are you referring to modals? If so, I'm glad I'm not the only person who has struggled with this. It took me a lot longer than expected just to get a modal working correctly in Angular. I felt stupid...like I was missing something.
- velox_io 11y ago> I felt stupid...like I was missing something. Angular does that to people. :) I started writing a library for dialogues (modal window, prompt, alert & confirmation), but stopped as it felt like re-inventing the wheel. Maybe such a library is needed after all..
- deleted 11y ago[deleted]
- buremba 11y agoIt's actually shame that we're already in 2015 and html date inputs are not standardized. http://caniuse.com/#feat=input-datetime http://caniuse.com/#feat=input-datetime
- mobinni 11y agoExactly what I thought, and even the browsers that can use it, it's not ideal to customize
- nickik 11y agoIts a shame something like a date picker needs to be framework specific.
- mobinni 11y agoWell it was a project specific feature I worked on that I was allowed to open source, that's why it's framework specific. I would like to port it to vanillaJS, but even then it wouldn't fit the requirements of many MV* cultures
- uptownhr 11y agoI really wish you can also add in a time picker on here. I don't understand how most datepickers choose not to include a time picker as well.
- uptownhr 11y agoSorry, let me knot discredit the nice date picker. I just wish you can add the time picker as well :). I'd definitely use it!
- lyschoening 11y agoIt looks nice enough, but it's not Material Design. http://www.google.com/design/spec/components/pickers.html http://www.google.com/design/spec/components/pickers.html
- afandian 11y agoWhy should it be?
- mobinni 11y agoI think what he means it doesn't comply with the Android implementation. At first I wanted to make it like that, but it didn't seem like it would comply with UX of websites.
- mobinni 11y agoTrue, it's a poorly chosen name. Once I make a range of components I will rename it.
- arxpoetica 11y agoWe built one recently for my company using Ractive.js and moment.js. Suprisingly, it was relatively easy to do (as far as working with date/time/timezone goes).
- 10dpd 11y agoUnfortunately this is completely inaccessible - try using the picker using tab, space, enter and arrow keys.