Re:Show HN: Made my own date picker for AngularJS
by fougerejo on Wednesday April 22, 2015 @07:01AM
(#9419545)
One 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..
Re:Show HN: Made my own date picker for AngularJS
by kagamine on Wednesday April 22, 2015 @07:58AM
(#9419750)
I'm actually relieved to find out it isn't just me and that others have been frustrated by this too.
My boss thinks I'm an idiot because I struggled with ui-datepicker in angular (being used in a search field). I had to over-explain that it is broken and still noone believes me when I tell them that the Jenkins build gives a different result from the same build but on localhost.
The second time around went better as I was forewarned, but then I had to have 2 datepickers (from and to dates) and that broke it scope-wise.
Re:Show HN: Made my own date picker for AngularJS
by Bahamut on Wednesday April 22, 2015 @08:56AM
(#9420009)
It should be mentioned, the UI Bootstrap one has a lot of fixes in master currently that addresses the issues - we are close to the 0.13.0 release (after work by a new core team that was assembled a month and a half ago), which should address the problems with Angular 1.3 present in 0.12. Angular 1.4 compatibility should be quick from there, along with massive performance improvements in 0.13.1.
Re:Show HN: Made my own date picker for AngularJS
by robinson7d on Wednesday April 22, 2015 @09:34AM
(#9420257)
It's not a particularly great wrapper (I've had to handle a couple minor issues in a further wrapper directive), but for the two-pickers situation where you want a range, I've recently used https://github.com/fragaria/angular-daterangepicker
Re:Show HN: Made my own date picker for AngularJS
by IkmoIkmo on Wednesday April 22, 2015 @12:49PM
(#9421702)
Same experience here. Caught me by surprise, thought I'd just inject one of many solid ones... Ended up building something custom myself (which is a bit of a pain as dates in JS isn't the most straightforward thing in the world).
Re:Show HN: Made my own date picker for AngularJS
by louhike on Wednesday April 22, 2015 @07:33AM
(#9419651)
Dates 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.
In theory they allow using the platform convention (i.e. on iOS the native datepicker is usually much nicer than whatever you can do in HTML).
Luckily Spartan (new Internet Explorer) will support it. Unfortunately given the recent track record of Safari development, I don't think we'll see support across all browsers anytime soon.
Re:Show HN: Made my own date picker for AngularJS
by maaaats on Wednesday April 22, 2015 @07:11AM
(#9419574)
It'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.
Re:Show HN: Made my own date picker for AngularJS
by mobinni on Wednesday April 22, 2015 @07:31AM
(#9419637)
At 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/ you can test it.
Re:Show HN: Made my own date picker for AngularJS
by mobinni on Wednesday April 22, 2015 @07:33AM
(#9419654)
Technically you are right, but I find that as a developer when management decides on a certain path of technology you have to work around it's flaws and try to make something that has the look and feel of something made with quality, even if the code will turn out ugly 99% of the time
Re:Show HN: Made my own date picker for AngularJS
by arxpoetica on Wednesday April 22, 2015 @11:14AM
(#9421003)
We 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).
Re:Show HN: Made my own date picker for AngularJS
by atom-morgan on Wednesday April 22, 2015 @09:08AM
(#9420083)
When 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.
Re:Show HN: Made my own date picker for AngularJS
by mobinni on Wednesday April 22, 2015 @07:52AM
(#9419724)
Well 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
Re:Show HN: Made my own date picker for AngularJS
by mobinni on Wednesday April 22, 2015 @09:44AM
(#9420319)
I 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.
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..
My boss thinks I'm an idiot because I struggled with ui-datepicker in angular (being used in a search field). I had to over-explain that it is broken and still noone believes me when I tell them that the Jenkins build gives a different result from the same build but on localhost.
The second time around went better as I was forewarned, but then I had to have 2 datepickers (from and to dates) and that broke it scope-wise.
Which is itself just a directive wrapper around Dan Grossman's DateRange Picker for Bootstrap https://github.com/dangrossman/bootstrap-daterangepicker
Of course, those have a lot of dependencies, so if the app isn't using bootstrap/moment/etc. it isn't as useful.
This is why I don't understand the incredibly bad support for the HTML date/time inputs (http://caniuse.com/#feat=input-datetime)
In theory they allow using the platform convention (i.e. on iOS the native datepicker is usually much nicer than whatever you can do in HTML).
Luckily Spartan (new Internet Explorer) will support it. Unfortunately given the recent track record of Safari development, I don't think we'll see support across all browsers anytime soon.
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.
Really hope Angular 2.0 fixes some of this madness.
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..
I have not been able to find one using MD.
http://www.google.com/design/spec/components/pickers.html
PS: looks nice!