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

lightpick

Package Overview
Dependencies
Maintainers
1
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lightpick - npm Package Compare versions

Comparing version 1.1.1 to 1.1.2

6

CHANGELOG.md
# Changelog
All notable changes to this project will be documented in this file.
[1.1.2] - 2018-08-22
* new option: footer
[1.1.1] - 2018-08-16
* fixed bug #15
[1.1.0] - 2018-07-20

@@ -5,0 +11,0 @@ * drop support IE

@@ -168,2 +168,13 @@ var rangeText = function (start, end) {

}
});
// demo-12
new Lightpick({
field: document.getElementById('demo-12'),
singleDate: false,
numberOfMonths: 2,
footer: true,
onSelect: function(start, end){
document.getElementById('result-12').innerHTML = rangeText(start, end);
}
});

43

lightpick.js

@@ -54,2 +54,3 @@ /**

hideOnBodyClick: true,
footer: false,
locale: {

@@ -60,2 +61,4 @@ buttons: {

close: '×',
reset: 'Reset',
apply: 'Apply',
},

@@ -330,9 +333,24 @@ tooltip: ['day', 'days'],

self.el.innerHTML = '<div class="lightpick__inner">'
var html = '<div class="lightpick__inner">'
+ (opts.numberOfMonths > 1 ? renderTopButtons(opts, 'days') : '')
+ '<div class="lightpick__months"></div>'
+ '<div class="lightpick__tooltip" style="visibility: hidden"></div>'
+ '<div class="lightpick__months-of-the-year"></div>'
+ '</div>';
+ '<div class="lightpick__months-of-the-year"></div>';
if (opts.footer) {
html += '<div class="lightpick__footer">';
if (opts.footer === true) {
html += '<button type="button" class="lightpick__reset-action">' + opts.locale.buttons.reset + '</button>';
html += '<button type="button" class="lightpick__apply-action">' + opts.locale.buttons.apply + '</button>';
}
else {
html += opts.footer;
}
html += '</div>';
}
html += '</div>';
self.el.innerHTML = html;
document.querySelector(opts.parentEl).appendChild(self.el);

@@ -444,5 +462,8 @@

}
else if (target.classList.contains('lightpick__close-action')) {
else if (target.classList.contains('lightpick__close-action') || target.classList.contains('lightpick__apply-action')) {
self.hide();
}
else if (target.classList.contains('lightpick__reset-action')) {
self.reset();
}
else if (target.classList.contains('lightpick__month-title')) {

@@ -521,3 +542,3 @@ if (target.hasAttribute('data-ym')) {

if (opts.repickTrigger !== opts.field) {
if (((opts.startDate && !opts.endDate) || opts.repickTrigger === opts.secondField) && dt.isSameOrBefore(opts.startDate)) {
day.classList.add('is-flipped');

@@ -993,2 +1014,14 @@ }

reset: function()
{
this.setStartDate(null, true);
this.setEndDate(null, true);
updateDates(this.el, this._opts);
if (typeof this._opts.onSelect === 'function') {
this._opts.onSelect.call(this, this.getStartDate(), this.getEndDate());
}
},
reloadOptions: function(options)

@@ -995,0 +1028,0 @@ {

2

package.json
{
"name": "lightpick",
"version": "1.1.1",
"version": "1.1.2",
"description": "Javascript date range picker - lightweight, no jQuery",

@@ -5,0 +5,0 @@ "main": "lightpick.js",

@@ -173,5 +173,11 @@ [![npm version](https://badge.fury.io/js/lightpick.svg)](https://www.npmjs.com/package/lightpick) [![license](https://img.shields.io/github/license/mashape/apistatus.svg)](https://github.com/wakirin/lightpick/blob/master/LICENSE)

### footer
- Type: `Boolean|String`
- Default: `false`
Footer calendar, if set to `true` will use default footer (Reset/Apply buttons) or custom string (html).
### locale
- Type: `Object`
- Default: `{ buttons: { prev: '<', next: '>', close: '×'}, tooltip: ['day', 'days'] }`
- Default: `{ buttons: { prev: '<', next: '>', close: '×', reset: 'Reset', apply: 'Apply'}, tooltip: ['day', 'days'] }`

@@ -178,0 +184,0 @@ Text for buttons, tooltip.

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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