Code Monkey home page Code Monkey logo

angular-pickadate.js's Introduction

angular-pickadate.js

Angularjs extension for the slick date/time picker, pickadate.js by Amsul

The use is very simple once you include this directive:

<input type="text" pick-a-date="curDate" />
<input type="text" pick-a-time="curDate" />

I went over my head for you guys and added constraints for min/max. Here is how you can use them. Merry xmas!

From: <input type="text" pick-a-date="startDate" max-date="endDate" />
To: <input type="text" pick-a-date="endDate" min-date="startDate" />

Options

pickadate.js by Amsul has a lot of options. You can control the options by through these directives as well. For the pick-a-date directive use pick-a-date-options. For the pick-a-time directive use pick-a-time-options. Pass in a structure like this { ... } with all the options you can think of. They will be passed to the directive. Example:

<input type="text" pick-a-date="curDate" pick-a-date-options="{ format: 'dd/mm/yy', selectYears: true }" />

Notes

  • Please note that I am using the latest and greatest version of AngularJS (v1.2.12). If you try to use a crappy old version like 1.0.2, there will be errors.
  • For more information on the date filter in AngularJS please visit [http://docs.angularjs.org/api/ng/filter/date].
  • Watch out for UTC times. Apparently the default way AngularJS serializes your time is with the T…Z pattern, meaning it is the time in Greenwich.

Here is the original blog post about this piece of code: Coding Insight

angular-pickadate.js's People

Contributors

miktemk avatar

Stargazers

Ruben Helsloot avatar matthias koch avatar 牛さん avatar Billy Catherall avatar Gabo Lugo avatar Bulut Korkmaz avatar Marc Siegel avatar kplates avatar Igor Davydov avatar

Watchers

James Cloos avatar  avatar matthias koch avatar

angular-pickadate.js's Issues

Month and year drop down not responsive.

I have the angular-pickadate widget set up like this:

<input type="text" data-role="none" pick-a-date="date" pick-a-date-options="{selectYears: true, selectMonths: true}" ng-model="row.ExpiryDate" class="custom-input date-from-utc-st-exp" data-utcdate="{{ row.ExpiryDate }}" value="{{ row.ExpiryDate }}" />

Although the drop down is rendered correctly with the month and year drop downs displayed, if I click on either of them, nothing happens. Also, if I press one of the arrow keys, it causes the browser tab to hang.

Conflict with latest version of pickadate

Hi.
I was/am using this directive, and upgraded the version of Pickadate library as it claims to fix some iOS8 issues. However on switching to the latest version, there are issues when selecting a date - it highlights/selects the wrongs dates. In particular this works with pass dates.

I've attached a version using the latest library.
https://www.dropbox.com/s/3i79nfoenvvmnpt/angular-pickadate.js-master-broken.zip?dl=0

Thanks
Tom

edit - this is probably just an issue with the library, rather than the directive. I've raised a bug here: amsul/pickadate.js#556

Bugs in the demo

In the zip file downloaded from I notice a couple of bugs.

If you select the first date input (which is empty) and try to prev/next a month, you get a JS error:
Cannot read property 'obj' of null
And the calendar sets itself to January 1970

Same thing happens if you press 'Today' first.

However if you select a date, and then reopen it, the calendar next/prev buttons work fine.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.