Giter Site home page Giter Site logo

ember-pikaday's Introduction

ember-pikaday

Ember Observer Score NPM

ember-pikaday provides a datepicker modifier & components for Ember using the Pikaday library.

This addon is fully integration tested, and it provides test helpers to interact with the datepicker in your own tests.

Installation

Prerequisites:

  • Ember.js v3.28 or above
  • ember-auto-import 2.0 or above

Optional prerequisites:

  • If you use the backward-compatible <PikadayInput> or <PikadayInputless> components, your app must depend on either moment or moment-timezone and you should remember to configure your locale and timezone requirements. See Using Moment.js in Ember Apps & Addons.
  • But if you only use the new <input {{pikaday}} /> modifier, moment or moment-timezone are optional. Pikaday itself uses them if they present, but doesn't require them.

Anti-prerequisites:

  • Remove ember-cli-moment-shim from your app. Earlier versions of this addon required it, but now it will only give you a redundant copy with the one provided by ember-auto-import.

Styles

In order to give apps control over styling, the default CSS does not load unless you tell it to. The recommended way to load the CSS is to create this file:

// app/modifiers/pikaday.js

/* Opt-in to using pikaday's default CSS */
import 'ember-pikaday/pikaday.css';
export { default } from 'ember-pikaday/modifiers/pikaday';

This guarantees that the CSS will load whenever your app uses the {{pikaday}} modifier (and the {{pikaday}} modifier is used internally by all the other provided components, so this covers them too).

Usage

{{pikaday}} modifier

The {{pikaday}} modifier invokes new Pikaday() with your element as Pikaday's field option:

<input
  {{pikaday
    format='DD.MM.YYYY'
    value=this.startDate
    onSelect=this.setStartDate
  }}
/>

The optional value argument can be used to synchronize external changes into Pikaday. Internally, we do this using Pikaday's setDate.

All other named arguments are passed directly to Pikaday, so see Pikaday's configuration docs.

The only behaviors this modifier adds to the stock Pikaday are:

  • if you set your <input> element's disabled attribute we will close Pikaday if it had been open.

<PikadayInput> Component

While the input shows a formatted date to the user, the value attribute can be any valid JavaScript date including Date object. If the application sets the attribute without a user interaction the datepicker updates accordingly.

<label>
  Start date:
  <PikadayInput @onSelection={{action 'doSomethingWithSelectedValue'}} />
</label>

You can also pass in other closure actions to handle onOpen, onClose and onDraw events.

<label>
  Start date:
  <PikadayInput
    @onOpen={{action 'doSomethingOnOpen'}}
    @onClose={{action 'doSomethingOnClose'}}
    @onDraw={{action 'doSomethingOnDraw'}}
  />
</label>

You can also change the default format from DD.MM.YYYY to any format string supported by Moment.js.

<label>
  Start date:
  <PikadayInput @format={{'MM/DD/YYYY'}} />
</label>

You can define a theme which will be a CSS class that can be used as a hook for styling different themes.

<label>
  Start date:
  <PikadayInput @theme={{'dark-theme'}} />
</label>

You can change the yearRange. It defaults to 10. the yearRange can be a single number or two comma separated years.

<label>
  Start date:
  <PikadayInput @yearRange={{'4'}} />
</label>
<label>
  Start date:
  <PikadayInput @yearRange={{'2004,2008'}} />
</label>

If the second year of the comma separated years is set to currentYear, it sets the maximum selectable year to the current year.

<label>
  Start date:
  <PikadayInput @yearRange={{'2004,currentYear'}} />
</label>

The readonly attribute is supported as binding so you can make the input readonly for mobile or other use cases.

<label>
  Start date:
  <PikadayInput @readonly={{'readonly'}} />
</label>

The placeholder attribute is supported as binding so you can improve the user experience of your interface.

<label>
  Due date:
  <PikadayInput @placeholder={{'Due date of invoice'}} />
</label>

The disabled attribute is supported as binding so you can disabled the datepicker entirely. If the datepicker is shown to the user and it gets disabled it will close the datepicker itself.

<label>
  Due date:
  <PikadayInput @disabled={{isDisabled}} />
</label>

The firstDay attribute is supported as a binding so you can set the first day of the calendar week. Defaults to Monday.

  • 0 = Sunday
  • 1 = Monday
  • etc...
<label>
  Due date:
  <PikadayInput @firstDay={{0}} />
</label>

The minDate attribute is supported as a binding so you can set the earliest date that can be selected.

<label>
  Due Date:
  <PikadayInput @minDate={{minDate}} />
</label>

The maxDate attribute is supported as a binding so you can set the latest date that can be selected.

<label>
  Due Date:
  <PikadayInput @maxDate={{maxDate}} />
</label>

Return dates in UTC time zone

The date returned by ember-pikaday is in your local time zone due to the JavaScript default behavior of new Date(). This can lead to problems when your application converts the date to UTC. In additive time zones (e.g. +0010) the resulting converted date could be yesterdays date. You can force the component to return a date with the UTC time zone by passing useUTC=true to it.

<label>
  Start date:
  <PikadayInput @useUTC={{true}} />
</label>

ember-pikaday will not automatically convert the date to UTC if your application is setting the datepicker value directly!

Using pikaday specific options

You can pass any custom pikaday option through the component like this

<label>
  <PikadayInput
    @options={{hash
      numberOfMonths=2
      disableWeekends=true
      disableDayFn=(action 'someAction')
    }}
  />
</label>

Please refer to pikaday configuration

<PikadayInputless>

If you don't want to show an input field, you can use the <PikadayInputless/> component instead of <PikadayInput/>. It has the same API, but doesn't support onOpen and onClose. When disabled=true on a pikaday-inputless, the datepicker gets hidden.

Localization

Localizing the datepicker is possible in two steps. To localize the output of the datepicker, this is the formatted string visible in the input field, you simply include all the locales by following the ember-cli-moment-shim instructions and include the following in your ember-cli-build.js

app.import('node_modules/moment/locale/de.js');

To localize the datepicker itself, this is the popup you see after clicking the input, a little more work is necessary. The preferred way to do this is to implement a custom component that extends the PikadayInput component and customizes the i18n attribute. The following example uses the translations provided by Moment.js - naturally you can use your own localized strings instead.

// app/components/pikaday-input.js

import PikadayInput from "ember-pikaday/components/pikaday-input";
import moment from "moment";

export default PikadayInput.extend({
  init(...args) {
    this._super(args);
    this.i18n = {
      previousMonth: 'Vorheriger Monat',
      nextMonth: 'Nächster Monat',
      months: moment.localeData()._months,
      weekdays: moment.localeData()._weekdays,
      weekdaysShort: moment.localeData()._weekdaysShort,
    };
  },
});

Examples

Show ember-pikaday when clicking on a button

<button {{action 'togglePika'}}>Show Pika</button>
{{#if showPika}}
  <PikadayInputless @value={{'2017-07-07'}} />
{{/if}}
// app/controller/index.js
import Ember from 'ember';
export default Ember.Controller.extend({
  actions: {
    togglePika() {
      this.toggleProperty('showPika');
    },
  },
});

Show ember-pikaday when hovering over a div

<div
  {{action 'showPika' on='mouseEnter'}}
  {{action 'hidePika' on='mouseLeave'}}
>
  Hover me to pika
  {{#if showPika}}
    <PikadayInputless @value={{'2017-07-07'}} />
  {{/if}}
</div>
// app/controller/index.js

import Controller from '@ember/controller';
export default Controller.extend({
  actions: {
    showPika() {
      this.set('showPika', true);
    },
    hidePika() {
      this.set('showPika', false);
    },
  },
});

Test Helpers

The test helpers provided by ember-pikaday allow you to interact with the datepicker in your integration and acceptance tests.

Opening Pikaday

To open the datepicker use click from the @ember/test-helpers package:

import { click } from '@ember/test-helpers';

await click('.my-pikaday-input');

Closing Pikaday

Pikaday can be closed with the provided close helper:

import { close as closePikaday } from 'ember-pikaday/test-support';

await closePikaday('.my-pikaday-input');

Interacting with Pikaday

An Interactor, like a page object, provides helpers for getting and setting dates in a date picker:

import { click } from '@ember/test-helpers';
import { Interactor as Pikaday } from 'ember-pikaday/test-support';

await click('#my-datepicker');
await Pikaday.selectDate(new Date(1989, 3, 28));

There are also methods available to check if a specific day, month or year is selected:

await Interactor.selectDate(new Date(1989, 3, 28));

assert.equal(Interactor.selectedYear(), 1989);
assert.equal(Interactor.selectedMonth(), 3);
assert.equal(Interactor.selectedDay(), 28);

Other Resources

ember-pikaday's People

Contributors

alexlafroscia avatar bdollard avatar betocantu93 avatar cah-danmonroe avatar danlatimer avatar danmonroe avatar dependabot-preview[bot] avatar dependabot[bot] avatar dertoti avatar duizendnegen avatar ef4 avatar eflanagan0 avatar efx avatar esbanarango avatar fabhof avatar fed03 avatar hakilebara avatar jasonmit avatar jeffreybiles avatar josemarluedke avatar lan0 avatar leizhao4 avatar leojpod avatar mansona avatar melsumner avatar patrick-emmanuel avatar peteonrails avatar stravid avatar turbo87 avatar yanglang avatar

Stargazers

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

Watchers

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

ember-pikaday's Issues

Deprecation warning with latest moment JS

After updating to the latest version of moment I'm seeing the following deprecation warning which originates in Pikaday:

Deprecation warning: moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.
Arguments: [object Object]
Error
    at Function.createFromInputFallback (http://localhost:7357/assets/vendor/moment/min/moment.min.js:17:1)
    at eb (http://localhost:7357/assets/vendor/moment/min/moment.min.js:129:1)
    at pb (http://localhost:7357/assets/vendor/moment/min/moment.min.js:169:1)
    at ob (http://localhost:7357/assets/vendor/moment/min/moment.min.js:169:1)
    at nb (http://localhost:7357/assets/vendor/moment/min/moment.min.js:167:1)
    at qb (http://localhost:7357/assets/vendor/moment/min/moment.min.js:174:1)
    at rb (http://localhost:7357/assets/vendor/moment/min/moment.min.js:174:1)
    at a (http://localhost:7357/assets/vendor/moment/min/moment.min.js:6:1)
    at comparableMoment (http://localhost:7357/assets/moment/index.js:29:1)
    at Class.setPikadayDate (http://localhost:7357/assets/ember-pikaday/components/pikaday-input.js:86:1)

edit: After downgrading moment I'm still seeing this - I think it might be linked to the latest version of ember-pikaday

Syntax for localization is for old versions of emberjs, hard coded text in i18n initializer code.

I am using your plugin in an application using ember 2.7.0. I needed localization and had
to adjust the code for the initializer for the version 2.7.0 of ember. Could you update your code/readme with the new syntax for later versions of ember?

import Ember from 'ember';
import moment from 'moment';

export function initialize(app) {
  const i18nService = app.__container__.lookup('service:i18n');
  moment.locale(i18nService.locale);

  var i18n = Ember.Object.extend({
    previousMonth: i18nService.t('previous.month'),
    nextMonth: i18nService.t('next.month'),
    months: moment.localeData()._months,
    weekdays: moment.localeData()._weekdays,
    weekdaysShort: moment.localeData()._weekdaysShort
  });

  app.register('pikaday-i18n:main', i18n, { singleton: true });
  app.inject('component:pikaday-input', 'i18n', 'pikaday-i18n:main');
}

export default {
  name: 'setup-pikaday-i18n',
  initialize
};

previousMonth and nextMonth were given hard coded text in German. I had to localize it using the i18n. I think it is another issue.

Format input output to user locale

I've been trying to set the format to user's locale format (the formatted string visible in the input field) to no availability.
The problem seems to be that the format parameter expects a format string eg {{pikaday-input format="MM/DD/YYYY"}} but it's impossible to find out what the browser's format is currently set.

I would actually expect the output to be processed with Date.prototype.toLocaleDateString() by default with the option to customize it using the format parameter.

It might be me missing something important. Do you have any suggestions?

"Assertion Failed: A helper named 'pikaday-input' could not be found"

No doubt I'm missing something stupid, but I've installed ember-pikaday as described in the readme, confirmed that it's in package.json and that pikaday is in bower.json, but when I add the component to my template I get the error Assertion Failed: A helper named 'pikaday-input' could not be found.

As it turns out I'm not going to be able to use this anyhow - what I actually need is day-month-year html select inputs for a date-of-birth field. A calendar picker is too awkward in that application, but for the sake of future use I'm still curious what I'm doing wrong here.

Format and Placeholder Option

On our edit page, we currently have the placeholder equal to the date that the user has previously selected. Will the format option with pikaday format that date to display the way we want it, i.e "MM-DD-YYYY"?

Pass unrecognised options to pikaday

I'd like to use a couple of options from pikaday that aren't yet implemented in this addon (trigger, position). Instead of manually aliasing them, would it be an idea to pass any unrecognised options on to pikaday?

[Ember 1.13.0] setDate not working ('this' is in state 'preRender')

Hi David,
setDate() is not working with the new ember beta (1.13.0-beta.1 incl. Glimmer).

setDate: function() {
  this.get('pikaday').setDate(this.get('value'), true);
}.observes('value'),

this is in state 'preRender' at that point in time what makes pikaday undefined.

Uncaught TypeError: Cannot read property 'setDate' of undefined

We could fix it like this:

setDate: function() {
  Ember.run.scheduleOnce('afterRender', this, function() {
    this.get('pikaday').setDate(this.get('value'), true);
  });
}.observes('value'),

Tests are green. Other uses of get('pikaday') don't seem affected. What do you think?

Could not find module ember-pikaday/components/pikaday-input

When I build or run my Ember app with --environment=production then I get the above error. I just re-npm'd the package and ran the generator to be sure, and after having done that, I look in node_modules/ember-pikaday/app/components/pikaday-input.js, which does an import, supposedly from ember-pikaday/components/pikaday-input, but that file doesn't exist. There is a pikaday-input.js in ember-pikaday/addon/components however, but if I add "addon" to the path, then it won't the compile step fails when running ember server.

Is the import statement wrong, or am I looking in the wrong place?

Here's the entire node_modules/ember-pikaday/app/components/pikaday-input.js:

import Ember from 'ember';
import PikadayInputComponent from 'ember-pikaday/components/pikaday-input';

export default PikadayInputComponent;

and the file tree is:

ember-pikaday
|__addon
|    |__components
|         |__pikaday-input.js
|__app
     |__components
          |__pikaday-input.js

clean field if date is not valid

Is there a way to clean the field if user type "wwwwwww"?, right now it only works just the very first time but after open the calendar select a date and then type an invalid date field does not get clear and onSelection is not fire

thanks

Loosing A Day

I'm trying to use ember-pikaday, but I'm having issues with it not displaying the correct date. Every time the date it displays, its the previous date of the actual date. For example if the date is 04/06/2016, it displays 04/05/2016. Below is the code that I am using, I have noticed though that if I replace value with placeholder, then the date does display correctly, just not in the right format, i.e. 2016-04-06. What's going on here?

{{pikaday-input id="effectiveDate" name="effectiveDate" class="form-control textCenter" format="MM/DD/YYYY" value=model.effectiveDate firstDay=0 disabled=isDisabledDate}}

Pikaday test method, specifically picker.selectedDay() not working.

It seems that picker.selectedDay() method is not working for me.

    var enddatePicker = openDatepicker(this.$('input')[1]);
    console.log(enddatePicker.selectedDay());
    enddatePicker.selectDate(new Date(2016, 7, 19));
    console.log(enddatePicker.selectedDay());
    enddatePicker.selectDate(new Date(2016, 7, 20));
    console.log(enddatePicker.selectedDay());
    enddatePicker.selectDate(new Date(2016, 7, 21));
    console.log(enddatePicker.selectedDay());
    enddatePicker.selectDate(new Date(2016, 7, 22));
    console.log(enddatePicker.selectedDay());
    enddatePicker.selectDate(new Date(2016, 7, 23));
    console.log(enddatePicker.selectedDay());
    enddatePicker.selectDate(new Date(2016, 7, 24));
    console.log(enddatePicker.selectedDay());
    enddatePicker.selectDate(new Date(2016, 7, 25));
    console.log(enddatePicker.selectedDay());
    enddatePicker.selectDate(new Date(2016, 7, 26));
    console.log(enddatePicker.selectedDay());
    enddatePicker.selectDate(new Date(2016, 7, 27));
    console.log(enddatePicker.selectedDay());
    enddatePicker.selectDate(new Date(2016, 7, 28));
    console.log(enddatePicker.selectedDay());

Each of the console.log returns a 4, even though it shouldn't be according to the docs.

Generate fails on something related to Font Awesome

The npm install appears to run fine, but when I do ember g ember-pikaday I get the following error after it cranks for a while. Not sure why it's doing anything with font-awesome, and besides, I already have that being imported into my project, so I don't need another.

  not-cached https://github.com/components/font-awesome.git#~4.2.0
Failed to execute "git ls-remote --tags --heads https://github.com/components/font-awesome.git", exit code of #128

stylesheet no longer loads after upgrade to ember-cli 2.6.1

After upgrading our app from ember-cli : 1.13.8 to ember-cli : 2.6.1 we lost any vendor styles we were getting from pikaday.

We are on ember-pikaday : 1.1.0, ember-cli : 2.6.1 and ember : 2.4.3

I have tried adding the line in ember-cli-build to import the css from pikaday app.import('bower_components/pikaday/css/pikaday.css'); with no success.

In order to get this working i've had to do the following @import 'bower_components/pikaday/css/pikaday'; into my app.scss

I have also tried upgrading to beta ember-pikaday with no success.

Wondering if this is a known issue or if anyone can help with resolution.

Should momentjs be just moment?

On the bower file you are referencing moment as

 "momentjs": "~2.8.3"

But the version registered on bower is just called moment.

Error output when installing on ember-cli 0.2.3 (but works fine after)

I'm getting this output when installing on ember-cli 0.2.3. The addon works fine afterwards, but it would be nice to get rid of the error message. I'm just dropping this here for now, but I should have time to come back later and investigate.

> ember install ember-pikaday
version: 0.2.3
Installed packages for tooling via npm.
installing
Installing browser packages via Bower...
  cached git://github.com/dbushell/Pikaday.git#1.3.2
Installed browser packages via Bower.
Installing browser packages via Bower...
  cached git://github.com/moment/moment.git#2.10.2
Installed browser packages via Bower.
installing
The `ember generate` command requires an entity name to be specified. For more details, use `ember help`.

DDAU hooks

I'm setting onSelect to (action 'dateSelected') but it's never firing that action. When you said: you can extend the pikaday-input component and overwrite certain callbacks, are you saying we should change your addon code directly?

Sorry and thanks!

Edit: Oh i got it doing onPikadaySelect instead. I think the docs need to be updated? I'll make a small pull request

Clear invalid input text

When the input is edited manually, the plugin should optionally validate the text content, and clear it if invalid.

How to show today button?

Does the addon has the feature of showing a Today button, which will highlight today's date when click?

Inputless Pikaday

I have a use-case where I want to show the interactive Pikaday calendar, but not attach it to an <input />. That's tricky to do with the current component (mostly because it's difficult to override the field: this.$()[0] option).

If you think this use-case would be a good one to include in this library, I'd be happy to work on extracting the common logic to a mixin or utility class.

What do you think?

Unable to set date range.

I would like to be able to set a dynamic date range that limits the ability of the user to selecting dates between 1915 and 18 years from the current date.
However when I set the year range let's say to 1915,1997 I can still select dates pass 1997 and I get no validation errors if I enter it manually.

Overriding event handler

Hi,

is it possible to override some event handlers or listen to other events? Specifically I need to validate the selected date, check if it's empty or not and then show a validation message.
I can't observe the value because the validation message will show up also when the page is loaded for the first time. I was thinking to listen to focus-out or close events but I can't figure out how to do that.

Thanks

DDAU

Now that Ember 1.13 is out and things are moving more towards data down, actions up, do you see moving ember-pikaday towards that paradigm instead of just two way bound attributes?

I'm having some issues dealing with the lack of granularity since I have two pikadays for custom date ranges, and then also some date range presets. When the user sets a date from pikaday, I want to set the preset to "Custom". But since all I can go off of is one of the dates changing, it's pretty hacky to detect this.

interactor.selectDate doesn't work in PhantomJS

interactor.selectDate doesn't work in PhantomJS. While after calling the method interactor.selectedMonth() and interactor.selectedYear(), interactor.selectedDay() is undefined. I believe that has to do with the mouseDown event that's triggered for selecting the day - I guess PhantomJS doesn't support that somehow or at least not the way you're firing it. I'm running PhantomJS 2.0.0.

Time-enabled Pikaday

Hi,

There is a very well maintained fork of pikaday that adds time-picking support as well (https://github.com/owenmead/Pikaday/). dbushnell even endorses this fork to an extent for people looking for date/time picking.

I'm planning on forking this repo to add support, but wanted to check to see if you thought there was another way to go about it I'm fairly certain you wouldn't want to change your dependency to the pikaday fork, but thought I'd doublecheck first.

Thanks for the great work!

momentjs needs changing to moment in a couple more files

After grabbing the latest from the repo, I was still getting this error when running ember server:
Path or pattern "bower_components/momentjs/moment.js" did not match any files [string exception]

I did a search through the ember-pikaday folder for 'momentjs' and found the following other occurrences:

ember-pikaday/index.js:
6: app.import('bower_components/momentjs/moment.js');

ember-pikaday/Brocfile.js:

19: app.import('bower_components/momentjs/moment.js');
20: app.import('bower_components/momentjs/locale/de-at.js');

It's also referenced in the Readme

Changing the references in index.js and Brocfile.js allowed me to run ember server without errors.

Placeholder attribute?

Is there interest in adding the ability to pass a placeholder ?

{{pikaday-input placeholder='Something'}}

Can open a PR for this if yes

Test helpers - error with touch event

Hi,

I used test helpers for ember-pikaday in my tests using Phantom.js and it throws: TypeError: undefined is not an object (evaluating 'event.changedTouches.length'). I think it's caused by that line:

var selectEvent = 'ontouchend' in document ? 'touchend' : 'mousedown';

Maybe it should be change to tap event?

Regards

DDAU doesn't support clearing input

clearing input is supported via 2 way data binding as seen here: 7293b77

onPikadayClose: function() {
  if (this.get('pikaday').getDate() === null || Ember.isEmpty(this.$().val())) {
    this.set('value', null);
  }
},

But we aren't sending a onSelectionChanged() event in that case. To get DDAU to work with clearing input events we would want to do something like:

onPikadayClose: function() {
  if (this.get('pikaday').getDate() === null || Ember.isEmpty(this.$().val())) {
    this.set('value', null);
    this.get('onSelection')(null);
  }
},

Change i18n locale after initialization

Is there a way to change the component's i18n localization language on the fly? In my app I set the i18n locale to the user's preference after getting that information from the store.

Localization

Hi, I dont't know if this is the right place to ask, if it is not, please tell me.
The question is: how can I change the locale?

Edit:
I changed this line:
//file = /node_modules/ember-pikaday/index.js
app.import('bower_components/momentjs/moment.js');
for theese:
app.import('bower_components/momentjs/min/moment.min.js');
app.import('bower_components/momentjs/locale/es.js');
And now it's working fine, thanks for this component, it's great.

stopPropagation for click event

Ver: v2.0.0-beta.1

"ember-pikaday" component does action of parent block when input field was clicked.
Example error:

<a id="dayPickerTrigger" {{action 'openDayPicker'}}>
    Day {{pikaday-input  onSelection=(action 'setDateLimitation' 'day')}}
</a>

Fix:

import PikadayInputComponent from 'ember-pikaday/components/pikaday-input';
export default PikadayInputComponent.extend({
  click(e)
  {
    e.stopPropagation();
  }
});

Configuring Pikaday?

Is it possible to pass configuration options to Pikaday?

It's important that the widget updates when properties passed as options change dynamically.

Passing theme value

Currently the newest (master) version of Pikaday is supporting custom classes for the datepicker but its not provided for this component.
You also dont have the possibility to pass any option. Can you add themes as an option like this?

var options = {
  ...
  theme: this.get('theme')
  ...
}

I saw on #9 something simular was requested there.

Ember pikaday isn't working with acceptance tests

After install it with ember-cli like: ember install ember-pikaday I'm getting this error:

Error: Could not find module ember-pikaday/components/pikaday-inputimported fromacdc/components/pikaday-input``

So I'm assuming that pikaday is not already including their dependencies inside the project.

I've tried to include the test helpers as well but it's still doesn't work.

Allow empty

Is there a way to allow null values? If I click in the input and clear the text it doesn't set the field to null value.

Is the `value` 2-way binding still working on 2.X?

Title question. I recently upgraded to 2.0.0 so that I'm able to clear the selected value, but I noticed that although I'm able to set the initial selected date, changing the date via Pikaday afterward doesn't change the bound value.

It is able to set the bound value to null when I clear the input though.

Is this an intended deprecation or is it a bug?

Hard coded format string in pikaday-mixin

if the pikaday component is not given any format in the template the default format is used.

Is it possible to use the localization feature to enable setting a default format?
I mean the code snippet in README.md for app/initializers/setup-pikaday-i18n.js.

The issue is related to #100 I think.

Thanks,

nomuna

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.