Giter Site home page Giter Site logo

ember-bootstrap-datetimepicker's Introduction

Ember-bootstrap-datetimepicker Build Status

Datetimepicker add-on for ember-cli

Installation

ember install ember-bootstrap-datetimepicker

Generate blueprints

ember generate ember-bootstrap-datetimepicker

BREAKING CHANGE for Ember 2

There are some breaking-changes when using this addon > v0.4.1

Two-way bindings are replaced by data down, actions up (DDAU). See: http://emberjs.com/blog/2015/06/12/ember-1-13-0-released.html#toc_ember-2-0-beta

Before:

{{bs-datetimepicker date=mydate format='YYYY-MM-DD'}}

After:

{{bs-datetimepicker date=mydate format='YYYY-MM-DD' updateDate=(action (mut model.date2))}}

Basic Usage

Template

{{bs-datetimepicker date=mydate format='YYYY-MM-DD'}}

Brocfile.js

The twitter bootstrap resources will not be imported to your resources by default. If you want the add-on to add it you have to specify it in the ember-cli-build.js. (This options will be deprecated)

var app = new EmberApp(defaults, {
  'ember-bootstrap-datetimepicker': {
  "importBootstrapCSS": true,
  "importBootstrapJS": true,
  "importBootstrapTheme": true
  }
});

Building yourself

Check out the demo on github pages. Alternatively you can clone this repo and run the app

sudo npm install -g ember-cli
git clone https://github.com/plusacht/ember-bootstrap-datetimepicker.git
cd ember-bootstrap-datetimepicker
npm install; bower install
ember serve

General Options

All options supported offered by bootstrap-datetimepicker are supported

Bound Options

date

Type: Date

This variable will be changed when the user changes the date and on the other side it will update the datetime picker when "date" is updated

minDate

Type: Date

When you change this variable the component trigger an update to the minDate on the jQuery plugin.

maxDate

Type: Date

When you change this variable the component trigger an update to the maxDate on the jQuery plugin.

disabledDates

Type: Date

When you change this variable the component trigger an update to the disabledDates on the jQuery plugin.

enabledDates

Type: Array Date

When you change this variable the component trigger an update to the enabledDates on the jQuery plugin.

forceDateOutput

Type: Boolean

Forces the parameter to updateDate to be a native javascript Date instead of a moment.js Date.

placeholder

Type: String

Placeholder support when input field is blank

Usage

Min / Maxdate example

Define your model

var App.DateExample = Ember.Object.create({
  date1: moment(),
  mindate: moment("2014-11-01"),
  maxdate: moment("2015-12-01"),
  disabled:true});
}

Add the component to your template and bind the model.mindate with the component's minDate.

{{bs-datetimepicker date=date1 minDate=mindate maxDate=maxdate}}

Change minDate so the jquery plugin will be updated with the minDate value

App.DateExample.set('maxdate', moment("2015-03-01"));

Ember Compatibility

0.4.0 - 0.4.1

  • 1.11.3
  • 1.12.1
  • 1.13.3

Credits

This add-on is based on bootstrap-datetimepicker

Legal

plus8 gmbh © 2014-2015

Licensed under the MIT license

ember-bootstrap-datetimepicker's People

Contributors

aymerick avatar bradplank avatar brett-anderson avatar btecu avatar claudiocro avatar givanse avatar jasonmit avatar jkatsnelson avatar joankaradimov avatar miguelcobain avatar offirgolan avatar rafaelbnp avatar seriousben 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

ember-bootstrap-datetimepicker's Issues

Ember 1.13

In 1.13 template triggers a deprecation warning. For checking if it's a block, hasBlock can be used.
However, it looks like the check is not necessary anyway, since bs-datetimepicker component doesn't support blocks anyway, so this should be removed:

{{#if template}}
  {{yield}}
{{else}}

NPM publish

@plusacht/owners please npm publish 1.0.3 and 1.0.4 (master) or feel free to add me jason.mitchell.w (at) gmail.com

I18n usage

Coming from Rails, I have some issue in localizing my project ... hw can I use 18n, with the bootstrap-datetimepicker ? thanks for adding a paragraph on it in the README ...

Assertion Failed: You modified [PROPERTY] twice on [MODEL] in a single render, after update to Ember 2.10

I'm getting an assertion when I click on any calendar icon in any of the instances of ember-bootstrap-datetimepicker.

"Assertion Failed: You modified requisition.start_date twice on <frontend@model:requisition::ember935:null> in a single render. This was unreliable and slow in Ember 1.x and is no longer supported. See https://github.com/emberjs/ember.js/issues/13948 for more details."

This only occurs when I pass the updateDate value into the component with a value of closure action involving the mut of some property, but if you don't do this then this addon doesn't function.

I understand that this is an issue with the Glimmer 2 rendering engine which is part of Ember 2.10, but I'm not familiar enough with this addon to suggest a fix yet.

disabledDates/enabledDates

Somebody got working disabled/Enabled dates?

I have tried with ember 1.13 and 2.2.0

like this:

{{bs-datetimepicker date=mydate disabledDates=["2015-12-24","2015-12-12"] format='YYYY-MM-DD' updateDate=(action (mut model.date2))}}

No error messages on console, but no disabled dates in calendar.

Merge error: file assets/bootstrap.css.map exists

With both "ember-bootstrap-datetimepicker": "~0.2.8" and ember-cli-bootstrap": "0.0.15" in package.json, an ember build causes:

Merge error: file assets/bootstrap.css.map exists in /home/dave/code/arbiter-front/tmp/custom_static_compiler-tmp_dest_dir-jYLYxoZS.tmp and /home/dave/code/arbiter-front/tmp/custom_static_compiler-tmp_dest_dir-sjr
elBHV.tmp
Pass option { overwrite: true } to mergeTrees in order to have the latter file win.
Error: Merge error: file assets/bootstrap.css.map exists in /home/dave/code/arbiter-front/tmp/custom_static_compiler-tmp_dest_dir-jYLYxoZS.tmp and /home/dave/code/arbiter-front/tmp/custom_static_compiler-tmp_dest_
dir-sjrelBHV.tmp
Pass option { overwrite: true } to mergeTrees in order to have the latter file win.
    at mergeRelativePath (/home/dave/code/arbiter-front/node_modules/ember-cli/node_modules/broccoli-merge-trees/index.js:98:21)

Resetting a bound date does not work

I am using this component on a search screen where the user can select a from and to date among a number of other options. I have a reset button which resets the model. What I have found is that the date binding does not reset to blank and retains the original value, everything else is reset as expected.

actions : {
    reset : function() {
       this.set('model', Ember.Object.create({}));
   }
}

how can I add custom name/id

I wanted to get a hold of the datepicker inside didInsertElement. How can I add an id/name to the component?

{{bs-datetimepicker id='txtCollectionDate' name='txtCollectionDate' date=null format="MM/DD/YYYY" pickTime=false showToday=true updateDate=(action 'updateCollectionDate') placeholder="Date"}}

Neither id/name get rendered. Also what can I import to get the actual bsDateTimePicker componet so I can act on it like bsDateTimePicker.date()

Using locales

Hello,

I try to use another language without success in ember-cli:

In .hbs file:

{{bs-datetimepicker date=reportDate format='DD.MM.YYYY' maxDate=maxDate locale="de"}}

In Brockfile.js:

app.import("bower_components/moment/min/moment.min.js");
app.import("bower_components/moment/locale/de.js");

Javascript console now outputs:

Uncaught TypeError: locale() locale de is not loaded from moment locales! bootstrap-datetimepicker.js:1504

However, it's possible to access moment.localeData('de') directly via Javascript console.

Any idea what I missed?

Kind regards
haggins

addon causes Ember to attempt to watch demo page app tests directory

Including the following lines in Brocfile.js in my existing Ember project causes this issue:

var EmberAddon = require('ember-cli/lib/broccoli/ember-addon');

var app = new EmberAddon({
  'ember-bootstrap-datetimepicker': { 
    'importBootstrapCSS': true,
    'importBootstrapJS': true,
    'importFontAwesome': true
  }
});

Error on ember server:

Attempting to watch missing directory: tests/dummy/app
Error: Attempting to watch missing directory: tests/dummy/app
    at EventEmitter.Watcher_addWatchDir [as addWatchDir] (/home/user/unisync/projects/scrubbed/project/ember/node_modules/ember-cli/node_modules/broccoli-sane-watcher/index.js:90:11)
    at /home/user/unisync/projects/scrubbed/project/ember/node_modules/ember-cli/node_modules/broccoli/lib/builder.js:67:35
    at lib$rsvp$$internal$$tryCatch (/home/user/unisync/projects/scrubbed/project/ember/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:489:16)
    at lib$rsvp$$internal$$invokeCallback (/home/user/unisync/projects/scrubbed/project/ember/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:501:17)
    at /home/user/unisync/projects/scrubbed/project/ember/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:1095:13
    at lib$rsvp$asap$$flush (/home/user/unisync/projects/scrubbed/project/ember/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:1290:9)
    at process._tickCallback (node.js:355:11)

Environment:

  • ember-cli 0.2.3
  • node 0.12.0
  • npm 2.7.6

Doesn't load locales

Just that!

Uncaught TypeError: locale() locale it-it is not loaded from moment locales!

The "defaultDate" option appears to be ignored

Set the defaultDate option on the {{bs-datetimepicker}} component to a valid Date.

Observed: No visible difference from a datetime picker where now defaultDate option is defined.

Expected: It's not entirely clear from the docs, but I think I'd expect the default date to be pre-selected in the datetime picker -- but think any placeholder text should remain visible in the input field(?).

Doesn't work with Ember v1.8.1

I get the following error when using this addon in my Ember app with Ember version 1.8.1.

Uncaught Error: Assertion Failed: You must use Ember.set() to set the classNames property (of Ember.TextField:ember344) to form-control.

Would you please fix this?

Cheers

date() parameter must be one of [null, string, moment or Date]

I have a form in http://localhost:4200/appointments/new and inside I have this:

{{bs-datetimepicker date=model.appointment.date format="LL"}}

But when ever I open the form page I get the same error

date() parameter must be one of [null, string, moment or Date]

:S isn't supposed that the model.x is null when creating a new element?

Upgrade broke custom icons

My project does not include bootstrap's glyphicons and the code to customize the icons no longer works.

BsDateTimePicker.reopen({
  icons: {
    time: "fa fa-clock-o",
    date: "fa fa-calendar",
    up: "fa fa-arrow-up",
    down: "fa fa-arrow-down"
  }
});

Error with Glimmer 2 [Ember 2.9.0 bata 3]

Hey there!

We are getting an error when using this addon with Ember 2.9.0 beta 3 where Glimmer 2 is the new rendering engine.

// bootstrap-datetimepicker.js:2254

Uncaught TypeError: input.size is not a function

The stack trace points to this block:

            input = element.find(options.datepickerInput);
            if (input.size() === 0) {
                input = element.find('input');
            } else if (!input.is('input')) {
                throw new Error('CSS class "' + options.datepickerInput + '" cannot be applied to non input element');
            }

Would be wonderful if you could take a look on this. Thanks.

Keeping Date object as type Date not moment()

When I pass a date into the component (planDate is a javascript Date object)

{{bs-datetimepicker date=planDate}}

The compoments converts it to a moment() object instead of a Date object. This causes problems when sending the date back to the server as the field in the ember-data model is of type DS.attr('date') and it sending it as null.

 Ember Inspector ($E):  Moment {_isAMomentObject: true, _i: "11:52 PM", _f: "h:mm A", _strict: false, _isUTC: false…}

When I run the toDate() function on the object the response is correct. I need it to do this by default.

Tue Dec 09 2014 23:54:00 GMT+1100 (AEDT)

I managed to get around this with the following but it is a bit messy.

{{bs-datetimepicker date=planDateProxy}}
    planDateProxy: function(key, value, previousValue) {
        // setter
        if (arguments.length > 1) {
            var date = value ? value.toDate() : null;
            this.set('model.planDate', date);
        }

        // getter
        return this.get('model.planDate');

    }.property('model'),

Doesn't work with Ember 1.8.0

I get the following error when using this addon (version ~4.14.30)

Uncaught Error: Assertion Failed: An error occured while setting up template bindings. Please check for invalid markup or bindings within HTML comments.
Ember.assert    @   ember.js:3865
_RenderBuffer.hydrateMorphs @   ember.js:39096
_RenderBuffer.element   @   ember.js:39341
EmberRenderer_createElement @   ember.js:39499
Renderer_renderTree @   ember.js:10619
(anonymous function)    @   ember.js:10696
DeferredActionQueues.invoke @   ember.js:679
DeferredActionQueues.flush  @   ember.js:749
Backburner.end  @   ember.js:135
Backburner.run  @   ember.js:190
run @   ember.js:18201
handleRegisteredAction  @   ember.js:20138
(anonymous function)    @   ember.js:38698
jQuery.event.dispatch   @   jquery.js:4670
jQuery.event.add.elemData.handle    @   jquery.js:4338

In other project with Ember 1.12.1 it works fine.
Unfortunately I can't upgrade Ember because this causes many other compatibility problems.

Would you please fix this?

A fragment cannot be pushed into a buffer that contains content

I followed the installation instructions and added the component like this:

{{bs-datetimepicker date=model.createdBefore format='MM-DD-YYYY'}}

The app now throws:

Assertion Failed: A fragment cannot be pushed into a buffer that contains content

Any ideas?

Assertion Failed: A helper named 'mut' could not be found

Not working with ember 1.10.0 version.

It gives the errors

  1. Assertion Failed: A helper named 'mut' could not be found
    for (action (mut time4))

  2. Uncaught TypeError: this.getAttr is not a function

    inputGroupClass: computed('attrs.noIcon', function () {
    if (!this.getAttr('noIcon')) {
    return 'input-group';
    }

Setting maxDate/minDate to null raises an error.

For the following code:

{{bs-datetimepicker date=from maxDate=date format="MM/DD/YYYY HH:mm" sideBySide=true}}

If date equals to null an error will be raised. However, if date equals to undefined everything will be fine. I consider setting a null value should work as it would work if set to undefined.

Stack trace:

Uncaught TypeError: maxDate() Could not parse date parameter: null
  picker.maxDate @ bootstrap-datetimepicker.js:1415
  (anonymous function) @ bootstrap-datetimepicker.js:1266

Do you want a PR for this?

Deprecation warning on Ember 2.18

I've been getting this deprecation warning on Ember 2.18.2:

DEPRECATION: An addon is trying to access project.nodeModulesPath. This is not a reliable way to discover npm modules. Instead, consider doing: require("resolve").sync(something, { basedir: project.root }). Accessed from: new NPMDependencyVersionChecker (/Users/rafaelpaiva/Code/poached-wordpress/poached-web/client/node_modules/ember-bootstrap-datetimepicker/node_modules/ember-cli-version-checker/src/npm-dependency-version-checker.js:11:33)

Resolve this warning by updating ember-cli-version-checker to version 2.0.0 or later.

default settings

Hi,

Thnx for addon, I have a question, simple one I hope ;)
How to set default settings so that I do not have to repeat it over and over again in each template.

For example I would like "Today button" to be allways displayed and would like to avoid repeating that option {{bs-datetimepicker showTodayButton=true}}.

Thnx

bsDateTimePicker is null

I followed the readme:

npm install ember-bootstrap-datetimepicker --save-dev
ember g ember-bootstrap-datetimepicker

And put in a {{bs-datetimepicker date=mydate format='YYYY-MM-DD'}}.

But I get this in the JS console:

Uncaught TypeError: undefined is not a function

Which comes from here, and sure enough if I put in a break point and this.get('bsDateTimePicker'), it's null. Any ideas?

After i installed ember-bootstrap-datetimepicker, i get this error message. Please help me.

DEPRECATION: Enumerable#contains is deprecated, use Enumerable#includes instead. [deprecation id: ember-runtime.enumerable-contains] See http://emberjs.com/deprecations/v2.x#toc_enumerable-contains for more details.
registerHandler/HANDLERS[type]@http://0.0.0.0:3001/assets/vendor.js:21555:7
raiseOnDeprecation@http://0.0.0.0:3001/assets/vendor.js:21475:7
registerHandler/HANDLERS[type]@http://0.0.0.0:3001/assets/vendor.js:21555:7
invoke@http://0.0.0.0:3001/assets/vendor.js:21571:7
deprecate@http://0.0.0.0:3001/assets/vendor.js:21539:5
deprecate@http://0.0.0.0:3001/assets/vendor.js:33746:12
_Mixin$create.contains@http://0.0.0.0:3001/assets/vendor.js:48696:7
_buildConfig@http://0.0.0.0:3001/assets/vendor.js:72685:14
didInsertElement@http://0.0.0.0:3001/assets/vendor.js:72594:52
superWrapper@http://0.0.0.0:3001/assets/vendor.js:39640:17
CoreView<.trigger@http://0.0.0.0:3001/assets/vendor.js:58566:16
superWrapper@http://0.0.0.0:3001/assets/vendor.js:39640:17
Renderer.prototype.didInsertElement@http://0.0.0.0:3001/assets/vendor.js:29409:7
Renderer_dispatchLifecycleHooks@http://0.0.0.0:3001/assets/vendor.js:29321:11
Renderer_renderTopLevelView@http://0.0.0.0:3001/assets/vendor.js:29295:7
Queue.prototype.invoke@http://0.0.0.0:3001/assets/vendor.js:15823:9
Queue.prototype.flush@http://0.0.0.0:3001/assets/vendor.js:15889:11
DeferredActionQueues.prototype.flush@http://0.0.0.0:3001/assets/vendor.js:15697:11
Backburner.prototype.end@http://0.0.0.0:3001/assets/vendor.js:15011:9
Backburner.prototype.run@http://0.0.0.0:3001/assets/vendor.js:15133:13
Backburner.prototype.join@http://0.0.0.0:3001/assets/vendor.js:15153:16
run.join@http://0.0.0.0:3001/assets/vendor.js:38605:12
run.bind/<@http://0.0.0.0:3001/assets/vendor.js:38668:14
resolve/</mightThrow@http://0.0.0.0:3001/assets/vendor.js:8184:21
resolve/</process<@http://0.0.0.0:3001/assets/vendor.js:8252:12

vendor.js (line 21463)
jQuery.Deferred exception: input.size is not a function

dateTimePicker@http://0.0.0.0:3001/assets/vendor.js:70828:17
$.fn.datetimepicker/<@http://0.0.0.0:3001/assets/vendor.js:70883:46
.each@http://0.0.0.0:3001/assets/vendor.js:4982:10
jQuery.prototype.each@http://0.0.0.0:3001/assets/vendor.js:4771:10
$.fn.datetimepicker@http://0.0.0.0:3001/assets/vendor.js:70878:16
didInsertElement@http://0.0.0.0:3001/assets/vendor.js:72594:30
superWrapper@http://0.0.0.0:3001/assets/vendor.js:39640:17
CoreView<.trigger@http://0.0.0.0:3001/assets/vendor.js:58566:16
superWrapper@http://0.0.0.0:3001/assets/vendor.js:39640:17
Renderer.prototype.didInsertElement@http://0.0.0.0:3001/assets/vendor.js:29409:7
Renderer_dispatchLifecycleHooks@http://0.0.0.0:3001/assets/vendor.js:29321:11
Renderer_renderTopLevelView@http://0.0.0.0:3001/assets/vendor.js:29295:7
Queue.prototype.invoke@http://0.0.0.0:3001/assets/vendor.js:15823:9
Queue.prototype.flush@http://0.0.0.0:3001/assets/vendor.js:15889:11
DeferredActionQueues.prototype.flush@http://0.0.0.0:3001/assets/vendor.js:15697:11
Backburner.prototype.end@http://0.0.0.0:3001/assets/vendor.js:15011:9
Backburner.prototype.run@http://0.0.0.0:3001/assets/vendor.js:15133:13
Backburner.prototype.join@http://0.0.0.0:3001/assets/vendor.js:15153:16
run.join@http://0.0.0.0:3001/assets/vendor.js:38605:12
run.bind/<@http://0.0.0.0:3001/assets/vendor.js:38668:14
resolve/</mightThrow@http://0.0.0.0:3001/assets/vendor.js:8184:21
resolve/</process<@http://0.0.0.0:3001/assets/vendor.js:8252:12

undefined
vendor.js (line 8460)
TypeError: input.size is not a function

Do not package travis-phantomjs (reduce installed size more than 1000 times)

Disclaimer: I am not a user of this package, this was found during mass npm package downloading.

Atm, your npm package ember-bootstrap-datetimepicker 0.6.0 has packaged size 37 MiB, and installed size 70.55 MiB.

70.50 MiB of that is inside the ./travis-phantomjs dir. 17 MiB of that is the file ./travis-phantomjs/phantomjs-2.0.0-ubuntu-12.04.tar.bz2.

I suspect that those files were accidently packaged.

Maintainer(s)

Hi @ claudiocro,

First of all, thanks for your work developing this addon.
I'm wondering if you're up to allow extra maintainers.

I would be happy to help maintaining this addon by triaging issues, reviewing PR's and creating releases.

Thanks in advance

☀️

Impossible to clear value?

It seem that it is not possible to reset the value of this picker to null/undefined/etc. If you click on the icon it automatically selects a date for you. Which is a little bit odd, but ok... But then the impossible to live with problem is that then there is no undoing "your" selection. If you want another date, that's ok. Just type or choose one from the calendar, but if you decided you didn't want to specify data at all your out of luck. You can clear the input field and it looks like the date is gone, but that has no effect on the internal state of the component nor the fields bound to the components date. Am I missing something obvious or how can this be?

template causes issues when wrapping the component.

The problem with templates on any basic control is that it renders an unnecessary div tag which screws up other components that wrap the control and also css. In my case, I use a component ember-aupac-control which allows me to add errors, icons etc.

The tempalte:

{{#if hasBlock}}
  {{yield}}
{{else}}
  {{input type="text" class="form-control" disabled=disabled name=textFieldName}}
{{/if}}
{{#unless noIcon}}
<span class="input-group-addon">
  <span class="{{dateIcon}}"></span>
</span>
{{/unless}}

Even if you yield the input control only

{{bs-datetimepicker}}
   <input type="text">
{{/bs-datetimepicker}}

The results is still

<div>
   <input type="text">
</div>

If the control used tagName="input", this would eliminate the issue and as a bonus allow the user to style the tag using class="form-control something-else". This would make dateIcon redundant but then the user can always wrap it themselves. I see that the styling of the control with an icon, error states, messages etc. can be pushed to a separate wrapper component anyway (bootstrap-wrapper) which can be used to style all sorts of controls not just the datepicker.

If you were to use tagName:

{{bs-datetimepicker date=someDate}}

would result in:

<input type="text">

Not installing, npm error

Tried ember install ember-bootstrap-datetimepicker and I get:

shasum check failed for /tmp/npm-27982-cf052115/registry.npmjs.org/ember-bootstrap-datetimepicker/-/ember-bootstrap-datetimepicker-0.6.0.tgz
Expected: 7bbe4cbf7b0e843d2d331a78af2075f38a6f1c0b
Actual:   d113a802b1007efd5a0d691b1f53a6c84fdab59d
From:     https://registry.npmjs.org/ember-bootstrap-datetimepicker/-/ember-bootstrap-datetimepicker-0.6.0.tgz
Error: shasum check failed for /tmp/npm-27982-cf052115/registry.npmjs.org/ember-bootstrap-datetimepicker/-/ember-bootstrap-datetimepicker-0.6.0.tgz
Expected: 7bbe4cbf7b0e843d2d331a78af2075f38a6f1c0b
Actual:   d113a802b1007efd5a0d691b1f53a6c84fdab59d
From:     https://registry.npmjs.org/ember-bootstrap-datetimepicker/-/ember-bootstrap-datetimepicker-0.6.0.tgz
    at /var/www/diezpe/diezpe-dashboard/node_modules/ember-cli/node_modules/npm/node_modules/sha/index.js:38:8

Using this from an addon project

I am pulling this into an addon project which I share among a number of sub projects. I have found that I need to run ember g ember-bootstrap-datetimepicker to pull down all the bower dependencies or I get errors about missing bower dependencies. So If I had 10 subprojects plus the single addon project, I would need to do this 11 times.

It is possible to automatically serve these bower dependencies to consuming applications of an addon project?

Remove importBootstrap options

This addon depends on boostrap but in my opinion it should not import the bootstrap assets itself, this should be done in the application.

Remove this options:

  • importBootstrapCSS
  • importBootstrapJS
  • importBootstrapTheme
  • importFontAwesome

How do I initialize the datepicker on route navigation?

the date picker works if I refresh the page (or just manually type in the URL that has the datepicker)

but if I navigate to it, the datepicker isn't initialized, and the text field is just a text field.

Here are the two templates that I navigate between:

this one is at /events/:id//edit/
https://github.com/NullVoxPopuli/aeonvera-ui/blob/upgrade-to-ember-2/app/templates/events/show/edit/index.emblem

and

this one is at /events/:id/edit/options
https://github.com/NullVoxPopuli/aeonvera-ui/blob/upgrade-to-ember-2/app/templates/events/show/edit/options.emblem

If I type one of those paths in to the address bar, and then click a link-to that takes me to the other route, the second route's date-time-pickers don't work.

JS error when trying to clear DateTimePicker

I have the 'showClear' option set to true on my template. But when I try to click the clear button I am getting ev.date.isSame is not a function. In addition, the value of the datetimepicker is getting reverted when trying to clear. I have keepInvalid=true but the datetimepicker is not allowing for blank or null values still. Does keepInvalid=true work with the Ember addon? Thanks in advance

Uncaught Error: Could not initialize DateTimePicker without an input element

I updated ember cli to 0.2.7 and I now I'm getting error when render template with this line:

bs-datetimepicker date=startedAtDate format='YYYY-MM-DD' disabled=disableStartedAtInput

I have ember-bootstrap-datetimepicker 0.4.1 and:
DEBUG: -------------------------------
ember.js:15358 DEBUG: Ember : 1.8.0
ember.js:15358 DEBUG: Ember Data : 1.0.0-beta.19
ember.js:15358 DEBUG: Handlebars : 1.3.0
ember.js:15358 DEBUG: jQuery : 1.11.3
ember.js:15358 DEBUG: Ember Simple Auth : 0.8.0-beta.2
ember.js:15358 DEBUG: Ember Simple Auth OAuth 2.0 : 0.8.0-beta.2
ember.js:15358 DEBUG: -------------------------------

With inline option template is rendered with input without possibility to select date.
I don't have idea how fix this, could you help me?

how to show the icon in the input field?

I followed the instructions but the input-group-addon span remained empty (no icon). I had to create the app/templates/components/bs-datetimepicker.hbs file in my ember-cli app to show it:

<div class="datetimepicker input-group date">
  {{view textFieldClass classNames="form-control" disabled=disabled name=textFieldName}}
  <span class="input-group-addon">
    <span class="glyphicon glyphicon-calendar"></span>
  </span>
</div>

Other icons are ok, just this was empty. Browsing the code I didn't find anything about setting the icon. What I'm missing?

Modifing property in causes significant performance degradation.

In the didInsertElement hook, one of the properties is explicitly updated,

this.set('bsDateTimePicker', bsDateTimePickerFn);

Which makes the date selecting significantly slower then the native js plugin, and also the ember-cli reports a deprecation warning

DEPRECATION: A property of <perx-dashboard@view:-outlet::ember476> was modified inside the didInsertElement hook. 
You should never change properties on components, services or models during didInsertElement because it causes significant performance degradation.
[deprecation id: ember-views.dispatching-modify-property]

Please kindly refactor this part a bit, the performance could be much boosted.
Cheers.

Can't force the picker to show/use UTC date?

Hi there.

This is an excellent addon for ember-cli, but I seem to be hitting a wall with the TZ used by the picker itself.

I have a ISO8601 activityDate 2015-08-27T21:27:00Z (example) being returned by my backend, and successfully loaded as moment.utc(value). However, as soon as the picker's value changes activityDate, it's now in my local tz and NOT still in UTC. I think what's happening here is that the picker's date value is instantiated as a new moment, which is where the local TZ is coming from.

I need this to display in UTC, regardless of the browser's current TZ. Is there an option that I'm missing here? Or am I borking up moment?

Cannot find module 'eonasdan-bootstrap-datetimepicker'

We recently took an npm dependency on v1.0.4. When running 'ember build -w', I am seeing the following error:

Cannot find module 'eonasdan-bootstrap-datetimepicker'
Error: Cannot find module 'eonasdan-bootstrap-datetimepicker'
at Function.Module._resolveFilename (module.js:339:15)
at Function.require.resolve (internal/module.js:23:19)
at Class.module.exports.treeForVendor (/home/eddie/dev/cooltrax/refresh/node_modules/ember-bootstrap-datetimepicker/index.js:59:38)

I think this means it needs to be promoted in the package.json from devDependencies to dependencies, right?

Input isn't prepopulated with date/time

So, I don't think I'm missing anything too obvious..
Why isn't the input here prefiled with the bound date? See here.

I've matched the default format exaclty (which appears to be ISO8601 with ms precision).

Datepicker hidden?

I've noticed that is some circumstances the datepicker is hidden by it's container.

Example below, is there a way to make the datepicker show above the container?

image

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.