Code Monkey home page Code Monkey logo

ember-cli-pickadate's People

Contributors

adrianwong81 avatar chrissloey avatar dandehavilland avatar demersus avatar ember-tomster avatar ghedamat avatar kategengler avatar mattcoker avatar montoias avatar vnazarenko avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

ember-cli-pickadate's Issues

How to change language?

Pickadate has support to over 40 languages, but it seems that the way it changes the language is by adding a /lib/translations/...js

Is there an easy way to change language in ember-cli-pickadate?

Fix breaking changes in FastBoot 1.0

The current ember-cli-fastboot releases (1.0.0-rc.1 and above) introduce breaking changes. These will most likely break your current FastBoot implementation.

See ember-fastboot/ember-cli-fastboot#387 for more information and a guide on how to fix your addon. Also you may want to visit the -fastboot Slack channel to get help from other users.

Note: this issue has been created automatically, by searching for certain patterns in your code. If you think this has been falsely created, feel free to close!

assigning value, formatting date

I'm not sure I understand how I pull the value from the datepicker. For example, in ember you can do this:
{{input value=dob}}
and then the output can be:
{{dob}}

For the datepicker, I have this:
{{pick-a-date date=(readonly date) on-selected=(action (mut date)) placeholder="Pick a date" options=(readonly extraPickadateOptions)}}

and if I do this: {{date}} it will display the date, but a long form version of it?

My question is, what if I wanted to change the value, so instead of date.. it's dob and then how do I display the same value {{dob}} ?

As of now it does this:
5, June 2016 (in the input field) and then displayed it shows: Sun Jun 05 2016 16:52:36 GMT-0400 (EDT)

How do i pass the options object

I'm lost on how do i pass the options object, examples in the readme file would be highly appreciated, lets say i want to change the months to the short version, showMonthsShort: true, i don't know how do i pass this options :(

Example of acceptance testing

Do you have an example of acceptance testing with ember-cli-pickadate? I tried using Ember's test helper click, but that doesn't open the date-picker. I've also tried filling in dates using the fillIn helper, but they don't get actually set, most likely because they are readonly fields.

Remove Bower As Dependency

Hey there awesome repo ๐ŸŽ‰ but most ember projects at this point have removed bower as a dependency in favor or yarn / npm. Any chance we could this this here?

Bug with 31th day

When I choose for the first time after refresh page the 31th of any month I get 1th of that month. If I choose then another date and after that come back to 31th it works fine. But for the first time after page refresh I get 1st of that month instead of 31th.

{{pick-a-date date=(readonly date) on-selected=(action (mut date)) placeholder="Pick a date" options=(readonly extraPickadateOptions)}}

Bug when selecting date when number of days in selected month is less than today (e.g. 31 March)

For example today is 31 March. When I try to select any date in April (30 days) like 20 April, the result will become 20 May. The same thing happens for June (e.g. 20 June becomes 20 July).

After some debugging I believe the source of the bug appears to be the following 4 lines in the onSelected function:
var newDate = new Date(date);
newDate.setYear(dateItem.year);
newDate.setMonth(dateItem.month);
newDate.setDate(dateItem.date);

The following javascript illustrates the problem:
// Want to select 20 April 2016, the current date is 31 March 2016
testDate = new Date(2016, 2, 31); console.log(testDate); // 31 March 2016
testDate.setYear(2016); console.log(testDate); // 31 March 2016, so far so good
testDate.setMonth(3); console.log(testDate); // 1 May 2016, huh???
testDate.setDate(20); console.log(testDate); // 20 May 2016, not what we wanted

Further details about this javascript date "bug" can be found here:
http://stackoverflow.com/questions/14680396/the-date-getmonth-method-has-bug

To resolve this I recommend you replace the 4 lines previously mentioned with this:
var newDate = new Date(dateItem.year, dateItem.month, dateItem.date);

problem with first time selecting date in next month

I've struggled with such problem, today is 31 of January, when i change month and select any day of february, I'm getting date value with march date. For example:
Today is 31 of January. I'm selecting 4rd of February and date value is 4rd of March
It's happening when next month do not contain day currently selected. Please look into pull request

Editable Time seems to default to 11am - doesn't persist to model

this is how I'm calling the time picker

    = pick-a-time date=(readonly value) on-selected=(action (mut value)) options=(readonly timeOptions)

image
Notice on the right, the time is 10:48, but the time field shows 11am

Changing the time field doesn't update the time on the model.

Here are my time options from the component.

  timeOptions: function() {
    return {
      editable: true,
      formatSubmit: 'HH:i',
    };
  }.property(),

Global options?

Is there a way to set global options for pickadate? I'm using the component in several different places in my app, and I have the same pickadate options set in all those places. I could write a mixin with my desired options that gets consumed by every controller that uses pickadate, which is fine, but it would be cleaner if I could set it, in say, ember-cli-build.js (I believe only theme is configurable there, correct?)

Update pickadate library to latest version v4.0.0-0

Hi, I tried to update the bower dependency my self to pickadate#4.0.0-0 but I get an error

Error: ENOENT: no such file or directory, stat 'code/tmp/source_map_concat-input_base_path-EKwRYxkN.tmp/0/bower_components/pickadate/lib/picker.js'

I think this file has been renamed to: bower_components/pickadate/lib/ui-picker.js

error when using tag

I get this error in the console:

Error: Could not find module ember-get-config imported from ember-cli-pickadate/components/picker

Observing the value of a picker as Ember computed property

I want to observe the collection date so I can update my options to the delivery date (ie 2 days after whichever collection date is selected.)

Is there a way to do this? I have tried variations on:

{{pick-a-time value=collectionDate date=date placeholder="Pick a time" options=opts}}

and creating a computed property on the controller:

  pickUpDate: Ember.computed(collectionDate, function() {
    this.get('collectionDate');

}),

But I get collectionDate as undefined.

Adding Options

I can't quite figure out how to get options working in ember-cli-build.js.

I've tried variations on, for example :

var app = new EmberApp({
"ember-cli-pickadate": {
'disable': [
1, 4, 7
]
}
});

Am I getting the format incorrect?

Required value

Is there any way to be mandatory these fields before submitting to a form?

<div class="col-xs col-md col-xl search-bar-cell hidden-sm-down">
    {{pick-a-date
      class="form-control js-pickadate-date js-pickadate-start"
      name="start_date"
      date=(readonly starDate)
      on-selected=(action (mut starDate))
      placeholder="Start Date"
      options=(readonly extraPickadateOptions)
     required=true
    }}
  </div>
  <div class="col-xs col-md col-xl search-bar-cell hidden-sm-down">
    {{pick-a-time
      class="form-control js-pickadate-date js-pickadate-start"
      name="start_time"
      date=(readonly starTime)
      on-selected=(action (mut starTime))
      placeholder="Start Time"
      options=(readonly extraPickaTimeOptions)
    }}
  </div>

In the official documentation I suggest this, but the truth, this does not work.

Any idea how to solve it?

Pickadate options dont work

Whatever option I try to use doesn't make any change.

{{pick-a-time date=date format='T!ime selected: h:i a' formatLabel='h:i <!i>a</!i>' placeholder="Pick a time"}}

In this example nothing affects the component, it always uses standard format.

Any suggestions?

Conflicting translation file names error

Merge error: conflicting capitalizations:
pickadate/lib/translations/fa_IR.js in /home/me/Development/project/tmp/broccoli_merge_trees-input_base_path-k1PKjI4I.tmp/10
pickadate/lib/translations/fa_ir.js in /home/me/Development/project/tmp/broccoli_merge_trees-input_base_path-k1PKjI4I.tmp/10
Remove one of the files and re-add it with matching capitalization.
We are strict about this to avoid divergent behavior between case-insensitive Mac/Windows and case-sensitive Linux.

clicking doesn't close the date picker

It makes me have to click the close button to get rid of the modal.

Here is how I'm invoking the date picker:

    = pick-a-date date=(readonly value) nulls-date=true on-selected=(action (mut value)) options=(readonly dateOptions)

dateOptions from the component

  dateOptions: function() {
    return {
      selectMonths: true,
      selectYears: true,
      onSet: function(context) {
        this.close();
      }
    };
  }.property()

from package.json
"ember-cli-pickadate": "1.0.0",

on page load:


DEBUG: -------------------------------
DEBUG: Ember             : 2.1.1
DEBUG: Ember Data        : 2.0.1
DEBUG: jQuery            : 2.1.4
DEBUG: Ember Simple Auth : 1.0.0
DEBUG: -------------------------------

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.