Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ember-cli-bootstrap-datepicker

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ember-cli-bootstrap-datepicker - npm Package Compare versions

Comparing version 0.3.4 to 0.4.0

dist/assets/bootstrap.css.map

93

addon/components/datepicker-support.js

@@ -6,9 +6,6 @@ import Ember from 'ember';

setupBootstrapDatepicker: function() {
var self = this,
element = this.$(),
value = this.get('value'),
dates = [];
setupBootstrapDatepicker: Ember.on('didInsertElement', function() {
var self = this;
element.
this.$().
datepicker({

@@ -36,47 +33,32 @@ autoclose: this.get('autoclose'),

Ember.run(function() {
self.didChangeDate(event);
self._didChangeDate(event);
});
});
if (value) {
if (this.get('multidate')) {
// split datesIsoString by multidate separator
var multidateSeparator = this.get('multidateSeparator') || ',';
var isoDates = value.split(multidateSeparator);
this._updateDatepicker();
}),
// generate array of date objecs
dates = isoDates.map(function(date) {
return self._resetTime(new Date(date));
});
}
else {
dates = [self._resetTime(new Date(value))];
}
element.datepicker.
apply(element, Array.prototype.concat.call(['update'], dates));
}
}.on('didInsertElement'),
teardownBootstrapDatepicker: function() {
teardownBootstrapDatepicker: Ember.on('willDestroyElement', function() {
this.$().datepicker('remove');
}.on('willDestroyElement'),
}),
didChangeDate: function(event) {
var isoDate = null;
didChangeValue: Ember.observer('value', function() {
this._updateDatepicker();
}),
_didChangeDate: function(event) {
var value = null;
if (event.date) {
if (this.get('multidate')) {
// set value to array if multidate
isoDate = this.$().datepicker('getDates').map(function(date) {
return date.toISOString();
});
value = this.$().datepicker('getDates');
} else {
value = this.$().datepicker('getDate');
}
else {
isoDate = this.$().datepicker('getDate').toISOString();
}
}
this.set('value', isoDate);
this.set('value', value);
},
didChangeValue: function() {
_updateDatepicker: function() {
var self = this,

@@ -86,21 +68,21 @@ element = this.$(),

dates = [];
// If value is undefined or null, we don't want bootstrap-datepicker to
// display 1970-01-01. We want a blank value.
if (value) {
if (Ember.isArray(value)) {
dates = value.map(function(date) {
return self._resetTime(new Date(date));
});
} else {
dates = [self._resetTime(new Date(value))];
}
} else {
dates = [null];
switch (Ember.typeOf(value)) {
case 'array':
dates = value;
break;
case 'date':
dates = [value];
break;
default:
dates = [null];
}
element.datepicker.
apply(element, Array.prototype.concat.call(['update'], dates));
}.observes('value'),
dates = dates.map(function(date) {
return (Ember.isNone(date)) ? null : self._resetTime(date);
});
element.datepicker
.apply(element, Array.prototype.concat.call(['update'], dates));
},
// HACK: Have to reset time to 00:00:00 because of the bug in

@@ -113,2 +95,3 @@ // bootstrap-datepicker

date.setSeconds(0);
date.setMilliseconds(0);

@@ -115,0 +98,0 @@ return date;

@@ -10,5 +10,5 @@ /* jshint node: true */

app.import(app.bowerDirectory + '/bootstrap-datepicker/js/bootstrap-datepicker.js');
app.import(app.bowerDirectory + '/bootstrap-datepicker/dist/js/bootstrap-datepicker.js');
app.import(app.bowerDirectory + '/bootstrap-datepicker/dist/css/bootstrap-datepicker.css');
}
};
The MIT License (MIT)
Copyright (c) 2014 Alexander Sulim
Copyright (c) 2015 Alex Sulim

@@ -5,0 +5,0 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

{
"name": "ember-cli-bootstrap-datepicker",
"version": "0.3.4",
"description": "Datepicker component for Ember CLI based on bootstrap-datepicker",
"version": "0.4.0",
"description": "Datepicker component for Ember CLI based on bootstrap-datepicker. It doesn't have any external dependency except bootstrap-datepicker, supports popup and inline modes.",
"directories": {

@@ -21,22 +21,27 @@ "doc": "doc",

"devDependencies": {
"broccoli-asset-rev": "^2.0.0",
"broccoli-ember-hbs-template-compiler": "^1.6.1",
"ember-cli": "0.1.5",
"ember-cli-content-security-policy": "0.3.0",
"ember-cli-dependency-checker": "0.0.7",
"ember-cli-esnext": "0.1.1",
"broccoli-asset-rev": "^2.0.2",
"ember-cli": "0.2.2",
"ember-cli-app-version": "0.3.3",
"ember-cli-content-security-policy": "0.4.0",
"ember-cli-dependency-checker": "0.0.8",
"ember-cli-htmlbars": "0.7.4",
"ember-cli-ic-ajax": "0.1.1",
"ember-cli-inject-live-reload": "^1.3.0",
"ember-cli-qunit": "0.1.2",
"ember-data": "1.0.0-beta.12",
"ember-export-application-global": "^1.0.0",
"express": "^4.8.5",
"glob": "^4.0.5"
"ember-cli-qunit": "0.3.9",
"ember-cli-uglify": "1.0.1",
"ember-data": "1.0.0-beta.16.1",
"ember-export-application-global": "^1.0.2",
"ember-disable-prototype-extensions": "^1.0.0"
},
"keywords": [
"ember-addon",
"ember-cli",
"ember-datepicker",
"bootstrap",
"bootstrap-datepicker",
"datepicker"
],
"dependencies": {
"ember-cli-babel": "^4.0.0"
},
"ember-addon": {

@@ -43,0 +48,0 @@ "configPath": "tests/dummy/config",

# Ember CLI datepicker add-on
[![Build Status](https://travis-ci.org/soulim/ember-cli-bootstrap-datepicker.svg?branch=master&style=flat)](https://travis-ci.org/soulim/ember-cli-bootstrap-datepicker)
[![Ember Observer Score](http://emberobserver.com/badges/ember-cli-bootstrap-datepicker.svg)](http://emberobserver.com/addons/ember-cli-bootstrap-datepicker)
[![Code Climate](https://codeclimate.com/github/soulim/ember-cli-bootstrap-datepicker/badges/gpa.svg)](https://codeclimate.com/github/soulim/ember-cli-bootstrap-datepicker)
The add-on provides you a date input component based on amazing bootstrap-datepicker library. It supports popup and inline mode, and can be used in Ember CLI applications.
It doesn't have any external dependecy except bootstrap-datepicker.
[Online demo](http://sul.im/ember-cli-bootstrap-datepicker)

@@ -168,5 +172,7 @@

Type: `Boolean`
Type: `Boolean` or `String`
Default: `false`
> If true or “linked”, displays a “Today” button at the bottom of the datepicker to select the current date. If true, the “Today” button will only move the current date into view; if “linked”, the current date will also be selected. [More...](http://bootstrap-datepicker.readthedocs.org/en/latest/options.html#todaybtn)
```handlebars

@@ -210,2 +216,2 @@ {{bootstrap-datepicker value=expiresAt todayBtn=true}}

[MIT License](https://github.com/soulim/ember-cli-bootstrap-datepicker/blob/master/LICENSE.md)
[MIT License](https://github.com/soulim/ember-cli-bootstrap-datepicker/blob/master/LICENSE.md)
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc