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

@blueprintjs/datetime

Package Overview
Dependencies
Maintainers
1
Versions
257
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@blueprintjs/datetime - npm Package Compare versions

Comparing version 1.23.0 to 1.24.0

5

dist/common/classes.js
/*
* Copyright 2015 Palantir Technologies, Inc. All rights reserved.
* Licensed under the BSD-3 License as modified (the “License”); you may obtain a copy
* of the license at https://github.com/palantir/blueprint/blob/master/LICENSE
* and https://github.com/palantir/blueprint/blob/master/PATENTS
*
* Licensed under the terms of the LICENSE file distributed with this project.
*/

@@ -7,0 +6,0 @@ "use strict";

/*
* Copyright 2015 Palantir Technologies, Inc. All rights reserved.
* Licensed under the BSD-3 License as modified (the “License”); you may obtain a copy
* of the license at https://github.com/palantir/blueprint/blob/master/LICENSE
* and https://github.com/palantir/blueprint/blob/master/PATENTS
*
* Licensed under the terms of the LICENSE file distributed with this project.
*/

@@ -7,0 +6,0 @@ "use strict";

/*
* Copyright 2015 Palantir Technologies, Inc. All rights reserved.
* Licensed under the BSD-3 License as modified (the “License”); you may obtain a copy
* of the license at https://github.com/palantir/blueprint/blob/master/LICENSE
* and https://github.com/palantir/blueprint/blob/master/PATENTS
*
* Licensed under the terms of the LICENSE file distributed with this project.
*/

@@ -7,0 +6,0 @@ "use strict";

1

dist/common/monthAndYear.d.ts
export declare class MonthAndYear {
static fromDate(date: Date): MonthAndYear;
private date;

@@ -3,0 +4,0 @@ constructor(month?: number, year?: number);

/*
* Copyright 2016 Palantir Technologies, Inc. All rights reserved.
* Licensed under the BSD-3 License as modified (the “License”); you may obtain a copy
* of the license at https://github.com/palantir/blueprint/blob/master/LICENSE
* and https://github.com/palantir/blueprint/blob/master/PATENTS
*
* Licensed under the terms of the LICENSE file distributed with this project.
*/

@@ -19,2 +18,5 @@ "use strict";

}
MonthAndYear.fromDate = function (date) {
return date == null ? undefined : new MonthAndYear(date.getMonth(), date.getFullYear());
};
MonthAndYear.prototype.clone = function () {

@@ -21,0 +23,0 @@ return new MonthAndYear(this.getMonth(), this.getYear());

/*
* Copyright 2017 Palantir Technologies, Inc. All rights reserved.
* Licensed under the BSD-3 License as modified (the “License”); you may obtain a copy
* of the license at https://github.com/palantir/blueprint/blob/master/LICENSE
* and https://github.com/palantir/blueprint/blob/master/PATENTS
*
* Licensed under the terms of the LICENSE file distributed with this project.
*/

@@ -7,0 +6,0 @@ "use strict";

/*
* Copyright 2015 Palantir Technologies, Inc. All rights reserved.
* Licensed under the BSD-3 License as modified (the “License”); you may obtain a copy
* of the license at https://github.com/palantir/blueprint/blob/master/LICENSE
* and https://github.com/palantir/blueprint/blob/master/PATENTS
*
* Licensed under the terms of the LICENSE file distributed with this project.
*/

@@ -7,0 +6,0 @@ "use strict";

@@ -6,3 +6,3 @@ /// <reference types="react" />

import { IDatePickerBaseProps } from "./datePickerCore";
import { TimePickerPrecision } from "./timePicker";
import { ITimePickerProps, TimePickerPrecision } from "./timePicker";
export interface IDateInputProps extends IDatePickerBaseProps, IProps {

@@ -98,2 +98,8 @@ /**

/**
* Any props to be passed on to the `TimePicker`. `value`, `onChange`, and
* `timePrecision` will be ignored in favor of the corresponding top-level
* props on this component.
*/
timePickerProps?: ITimePickerProps;
/**
* Adds a time chooser to the bottom of the popover.

@@ -100,0 +106,0 @@ * Passed to the `DateTimePicker` component.

/*
* Copyright 2016 Palantir Technologies, Inc. All rights reserved.
* Licensed under the BSD-3 License as modified (the “License”); you may obtain a copy
* of the license at https://github.com/palantir/blueprint/blob/master/LICENSE
* and https://github.com/palantir/blueprint/blob/master/PATENTS
*
* Licensed under the terms of the LICENSE file distributed with this project.
*/

@@ -46,5 +45,5 @@ "use strict";

var momentDate = dateUtils_1.fromDateToMoment(date);
// this change handler was triggered by a change in month, day, or (if enabled) time. for UX
// purposes, we want to close the popover only if the user explicitly clicked a day within
// the current month.
// this change handler was triggered by a change in month, day, or (if
// enabled) time. for UX purposes, we want to close the popover only if
// the user explicitly clicked a day within the current month.
var isOpen = !hasUserManuallySelectedDate ||

@@ -155,3 +154,3 @@ _this.hasMonthChanged(prevMomentDate, momentDate) ||

var dateValue = this.isMomentValidAndInRange(value) ? dateUtils_1.fromMomentToDate(value) : null;
var popoverContent = this.props.timePrecision === undefined ? (React.createElement(datePicker_1.DatePicker, tslib_1.__assign({}, this.props, { onChange: this.handleDateChange, value: dateValue }))) : (React.createElement(dateTimePicker_1.DateTimePicker, { onChange: this.handleDateChange, value: dateValue, datePickerProps: this.props, timePickerProps: { precision: this.props.timePrecision } }));
var popoverContent = this.props.timePrecision === undefined ? (React.createElement(datePicker_1.DatePicker, tslib_1.__assign({}, this.props, { onChange: this.handleDateChange, value: dateValue }))) : (React.createElement(dateTimePicker_1.DateTimePicker, { canClearSelection: this.props.canClearSelection, onChange: this.handleDateChange, value: dateValue, datePickerProps: this.props, timePickerProps: tslib_1.__assign({}, this.props.timePickerProps, { precision: this.props.timePrecision }) }));
// assign default empty object here to prevent mutation

@@ -224,2 +223,3 @@ var _b = this.props, _c = _b.inputProps, inputProps = _c === void 0 ? {} : _c, _d = _b.popoverProps, popoverProps = _d === void 0 ? {} : _d;

popoverPosition: core_1.Position.BOTTOM,
timePickerProps: {},
};

@@ -226,0 +226,0 @@ DateInput.displayName = "Blueprint.DateInput";

/*
* Copyright 2015 Palantir Technologies, Inc. All rights reserved.
* Licensed under the BSD-3 License as modified (the “License”); you may obtain a copy
* of the license at https://github.com/palantir/blueprint/blob/master/LICENSE
* and https://github.com/palantir/blueprint/blob/master/PATENTS
*
* Licensed under the terms of the LICENSE file distributed with this project.
*/

@@ -27,3 +26,3 @@ "use strict";

var disabledDays = _this.props.dayPickerProps.disabledDays;
return disabledDays instanceof Array ? [_this.disabledDays].concat(disabledDays) : [_this.disabledDays, disabledDays];
return Array.isArray(disabledDays) ? [_this.disabledDays].concat(disabledDays) : [_this.disabledDays, disabledDays];
};

@@ -30,0 +29,0 @@ _this.renderCaption = function (props) { return (React.createElement(datePickerCaption_1.DatePickerCaption, tslib_1.__assign({}, props, { maxDate: _this.props.maxDate, minDate: _this.props.minDate, onMonthChange: _this.handleMonthSelectChange, onYearChange: _this.handleYearSelectChange }))); };

/*
* Copyright 2015 Palantir Technologies, Inc. All rights reserved.
* Licensed under the BSD-3 License as modified (the “License”); you may obtain a copy
* of the license at https://github.com/palantir/blueprint/blob/master/LICENSE
* and https://github.com/palantir/blueprint/blob/master/PATENTS
*
* Licensed under the terms of the LICENSE file distributed with this project.
*/

@@ -7,0 +6,0 @@ "use strict";

/*
* Copyright 2016 Palantir Technologies, Inc. All rights reserved.
* Licensed under the BSD-3 License as modified (the “License”); you may obtain a copy
* of the license at https://github.com/palantir/blueprint/blob/master/LICENSE
* and https://github.com/palantir/blueprint/blob/master/PATENTS
*
* Licensed under the terms of the LICENSE file distributed with this project.
*/

@@ -7,0 +6,0 @@ "use strict";

/*
* Copyright 2017 Palantir Technologies, Inc. All rights reserved.
* Licensed under the BSD-3 License as modified (the “License”); you may obtain a copy
* of the license at https://github.com/palantir/blueprint/blob/master/LICENSE
* and https://github.com/palantir/blueprint/blob/master/PATENTS
*
* Licensed under the terms of the LICENSE file distributed with this project.
*/

@@ -7,0 +6,0 @@ "use strict";

/*
* Copyright 2016 Palantir Technologies, Inc. All rights reserved.
* Licensed under the BSD-3 License as modified (the “License”); you may obtain a copy
* of the license at https://github.com/palantir/blueprint/blob/master/LICENSE
* and https://github.com/palantir/blueprint/blob/master/PATENTS
*
* Licensed under the terms of the LICENSE file distributed with this project.
*/

@@ -184,8 +183,6 @@ "use strict";

}
/*
* if the initial month is the last month of the picker's
* allowable range, the react-day-picker library will show
* the max month on the left and the *min* month on the right.
* subtracting one avoids that weird, wraparound state (#289).
*/
// if the initial month is the last month of the picker's
// allowable range, the react-day-picker library will show
// the max month on the left and the *min* month on the right.
// subtracting one avoids that weird, wraparound state (#289).
var initialMonthEqualsMinMonth = DateUtils.areSameMonth(initialMonth, props.minDate);

@@ -196,4 +193,9 @@ var initalMonthEqualsMaxMonth = DateUtils.areSameMonth(initialMonth, props.maxDate);

}
var leftView = new monthAndYear_1.MonthAndYear(initialMonth.getMonth(), initialMonth.getFullYear());
var rightView = leftView.getNextMonth();
// show the selected end date's encompassing month in the right view if
// the calendars don't have to be contiguous.
var leftView = monthAndYear_1.MonthAndYear.fromDate(initialMonth);
var rightDate = value[1];
var rightView = !props.contiguousCalendarMonths && rightDate != null
? monthAndYear_1.MonthAndYear.fromDate(rightDate)
: leftView.getNextMonth();
_this.state = { leftView: leftView, rightView: rightView, value: value, hoverValue: [null, null] };

@@ -230,2 +232,3 @@ return _this;

else {
// const rightMonth = contiguousCalendarMonths ? rightView.getFullDate()
return (React.createElement("div", { className: classNames(DateClasses.DATEPICKER, DateClasses.DATERANGEPICKER, className) },

@@ -331,8 +334,6 @@ this.maybeRenderShortcuts(),

var rightView = state.rightView.clone();
/*
* Only end date selected.
* If the newly selected end date isn't in either of the displayed months, then
* - set the right DayPicker to the month of the selected end date
* - ensure the left DayPicker is before the right, changing if needed
*/
// Only end date selected.
// If the newly selected end date isn't in either of the displayed months, then
// - set the right DayPicker to the month of the selected end date
// - ensure the left DayPicker is before the right, changing if needed
if (nextValueStart == null && nextValueEnd != null) {

@@ -346,10 +347,8 @@ var nextValueEndMonthAndYear = new monthAndYear_1.MonthAndYear(nextValueEnd.getMonth(), nextValueEnd.getFullYear());

}
/*
* Only start date selected.
* If the newly selected start date isn't in either of the displayed months, then
* - set the left DayPicker to the month of the selected start date
* - ensure the right DayPicker is before the left, changing if needed
*/
}
else if (nextValueStart != null && nextValueEnd == null) {
// Only start date selected.
// If the newly selected start date isn't in either of the displayed months, then
// - set the left DayPicker to the month of the selected start date
// - ensure the right DayPicker is before the left, changing if needed
var nextValueStartMonthAndYear = new monthAndYear_1.MonthAndYear(nextValueStart.getMonth(), nextValueStart.getFullYear());

@@ -362,15 +361,11 @@ if (!nextValueStartMonthAndYear.isSame(leftView) && !nextValueStartMonthAndYear.isSame(rightView)) {

}
/*
* Both start date and end date selected.
*/
}
else if (nextValueStart != null && nextValueEnd != null) {
// Both start date and end date selected.
var nextValueStartMonthAndYear = new monthAndYear_1.MonthAndYear(nextValueStart.getMonth(), nextValueStart.getFullYear());
var nextValueEndMonthAndYear = new monthAndYear_1.MonthAndYear(nextValueEnd.getMonth(), nextValueEnd.getFullYear());
/*
* Both start and end date months are identical
* If the selected month isn't in either of the displayed months, then
* - set the left DayPicker to be the selected month
* - set the right DayPicker to +1
*/
// Both start and end date months are identical
// If the selected month isn't in either of the displayed months, then
// - set the left DayPicker to be the selected month
// - set the right DayPicker to +1
if (DateUtils.areSameMonth(nextValueStart, nextValueEnd)) {

@@ -386,7 +381,5 @@ var potentialLeftEqualsNextValueStart = leftView.isSame(nextValueStartMonthAndYear);

}
/*
* Different start and end date months, adjust display months.
*/
}
else {
// Different start and end date months, adjust display months.
if (!leftView.isSame(nextValueStartMonthAndYear)) {

@@ -393,0 +386,0 @@ leftView = nextValueStartMonthAndYear;

/*
* Copyright 2016 Palantir Technologies, Inc. All rights reserved.
* Licensed under the BSD-3 License as modified (the “License”); you may obtain a copy
* of the license at https://github.com/palantir/blueprint/blob/master/LICENSE
* and https://github.com/palantir/blueprint/blob/master/PATENTS
*
* Licensed under the terms of the LICENSE file distributed with this project.
*/

@@ -7,0 +6,0 @@ "use strict";

/*
* Copyright 2015 Palantir Technologies, Inc. All rights reserved.
* Licensed under the BSD-3 License as modified (the “License”); you may obtain a copy
* of the license at https://github.com/palantir/blueprint/blob/master/LICENSE
* and https://github.com/palantir/blueprint/blob/master/PATENTS
*
* Licensed under the terms of the LICENSE file distributed with this project.
*/

@@ -7,0 +6,0 @@ "use strict";

/*
* Copyright 2016 Palantir Technologies, Inc. All rights reserved.
* Licensed under the BSD-3 License as modified (the “License”); you may obtain a copy
* of the license at https://github.com/palantir/blueprint/blob/master/LICENSE
* and https://github.com/palantir/blueprint/blob/master/PATENTS
*
* Licensed under the terms of the LICENSE file distributed with this project.
*/

@@ -7,0 +6,0 @@ "use strict";

/*
* Copyright 2015 Palantir Technologies, Inc. All rights reserved.
* Licensed under the BSD-3 License as modified (the “License”); you may obtain a copy
* of the license at https://github.com/palantir/blueprint/blob/master/LICENSE
* and https://github.com/palantir/blueprint/blob/master/PATENTS
*
* Licensed under the terms of the LICENSE file distributed with this project.
*/

@@ -7,0 +6,0 @@ "use strict";

/**
* Copyright 2016 Palantir Technologies, Inc. All rights reserved.
* Licensed under the BSD-3 License as modified (the “License”); you may obtain a copy
* of the license at https://github.com/palantir/blueprint/blob/master/LICENSE
* and https://github.com/palantir/blueprint/blob/master/PATENTS
*
* Licensed under the terms of the LICENSE file distributed with this project.
*/

@@ -7,0 +6,0 @@

{
"name": "@blueprintjs/datetime",
"version": "1.23.0",
"version": "1.24.0",
"description": "Components for interacting with dates and times",

@@ -38,3 +38,3 @@ "main": "dist/index.js",

"author": "Palantir Technologies",
"license": "BSD-3-Clause"
"license": "Apache-2.0"
}
/*
* Copyright 2015 Palantir Technologies, Inc. All rights reserved.
* Licensed under the BSD-3 License as modified (the “License”); you may obtain a copy
* of the license at https://github.com/palantir/blueprint/blob/master/LICENSE
* and https://github.com/palantir/blueprint/blob/master/PATENTS
*
* Licensed under the terms of the LICENSE file distributed with this project.
*/

@@ -7,0 +6,0 @@

/*
* Copyright 2015 Palantir Technologies, Inc. All rights reserved.
* Licensed under the BSD-3 License as modified (the “License”); you may obtain a copy
* of the license at https://github.com/palantir/blueprint/blob/master/LICENSE
* and https://github.com/palantir/blueprint/blob/master/PATENTS
*
* Licensed under the terms of the LICENSE file distributed with this project.
*/

@@ -7,0 +6,0 @@

/*
* Copyright 2015 Palantir Technologies, Inc. All rights reserved.
* Licensed under the BSD-3 License as modified (the “License”); you may obtain a copy
* of the license at https://github.com/palantir/blueprint/blob/master/LICENSE
* and https://github.com/palantir/blueprint/blob/master/PATENTS
*
* Licensed under the terms of the LICENSE file distributed with this project.
*/

@@ -7,0 +6,0 @@

/*
* Copyright 2016 Palantir Technologies, Inc. All rights reserved.
* Licensed under the BSD-3 License as modified (the “License”); you may obtain a copy
* of the license at https://github.com/palantir/blueprint/blob/master/LICENSE
* and https://github.com/palantir/blueprint/blob/master/PATENTS
*
* Licensed under the terms of the LICENSE file distributed with this project.
*/

@@ -11,2 +10,6 @@

export class MonthAndYear {
public static fromDate(date: Date) {
return date == null ? undefined : new MonthAndYear(date.getMonth(), date.getFullYear());
}
private date: Date;

@@ -13,0 +16,0 @@

/*
* Copyright 2017 Palantir Technologies, Inc. All rights reserved.
* Licensed under the BSD-3 License as modified (the “License”); you may obtain a copy
* of the license at https://github.com/palantir/blueprint/blob/master/LICENSE
* and https://github.com/palantir/blueprint/blob/master/PATENTS
*
* Licensed under the terms of the LICENSE file distributed with this project.
*/

@@ -7,0 +6,0 @@

/*
* Copyright 2015 Palantir Technologies, Inc. All rights reserved.
* Licensed under the BSD-3 License as modified (the “License”); you may obtain a copy
* of the license at https://github.com/palantir/blueprint/blob/master/LICENSE
* and https://github.com/palantir/blueprint/blob/master/PATENTS
*
* Licensed under the terms of the LICENSE file distributed with this project.
*/

@@ -7,0 +6,0 @@

/*
* Copyright 2016 Palantir Technologies, Inc. All rights reserved.
* Licensed under the BSD-3 License as modified (the “License”); you may obtain a copy
* of the license at https://github.com/palantir/blueprint/blob/master/LICENSE
* and https://github.com/palantir/blueprint/blob/master/PATENTS
*
* Licensed under the terms of the LICENSE file distributed with this project.
*/

@@ -7,0 +6,0 @@

@@ -22,2 +22,5 @@ ---

- [`DateRangeInput`](#datetime/daterangeinput), which composes two text inputs with a `DateRangePicker` in
a `Popover`, for use in forms.
They are available in the __@blueprintjs/datetime__ package on

@@ -24,0 +27,0 @@ [NPM](https://www.npmjs.com/package/@blueprintjs/datetime).

/*
* Copyright 2016 Palantir Technologies, Inc. All rights reserved.
* Licensed under the BSD-3 License as modified (the “License”); you may obtain a copy
* of the license at https://github.com/palantir/blueprint/blob/master/LICENSE
* and https://github.com/palantir/blueprint/blob/master/PATENTS
*
* Licensed under the terms of the LICENSE file distributed with this project.
*/

@@ -7,0 +6,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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