Skip to content

Commit

Permalink
Updated package.json to push to correct repo and fixing bug around se…
Browse files Browse the repository at this point in the history
…lection of the 31st.
  • Loading branch information
iamtomcat committed May 16, 2022
1 parent 8071a79 commit bdf9b01
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 33 deletions.
2 changes: 1 addition & 1 deletion dist/react-datetime.cjs.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/react-datetime.cjs.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/react-datetime.umd.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/react-datetime.umd.js.map

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
"name": "react-datetime",
"name": "@elevatedsignals/react-datetime",
"version": "3.1.0",
"description": "A lightweight but complete datetime picker React.js component",
"homepage": "https://github.com/arqex/react-datetime",
"repository": {
"type": "git",
"url": "https://github.com/arqex/react-datetime"
},
"main": "./dist/react-datetime.cjs.js",
"typings": "./typings/DateTime.d.ts",
"files": [
"css",
"dist",
"typings"
],
"repository": "git://github.com/elevatedsignals/elevatedpackages.git",
"publishConfig": {
"registry": "https://npm.pkg.github.com"
},
"scripts": {
"build": "webpack --config config/webpack.config.build.js",
"lint": "eslint src/DateTime.js test/ && echo 'Linting OK! 💪'",
Expand Down
48 changes: 24 additions & 24 deletions src/DateTime.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export default class Datetime extends React.Component {
onCalendarClose: nofn,
onChange: nofn,
onNavigate: nofn,
onBeforeNavigate: function(next) { return next; },
onBeforeNavigate: function(next) { return next; },
onNavigateBack: nofn,
onNavigateForward: nofn,
dateFormat: true,
Expand Down Expand Up @@ -110,7 +110,7 @@ export default class Datetime extends React.Component {
onClick: this._onInputClick
};

if ( this.props.renderInput ) {
if ( this.props.renderInput ) {
return (
<div>
{ this.props.renderInput( finalInputProps, this._openCalendar, this._closeCalendar ) }
Expand Down Expand Up @@ -149,18 +149,18 @@ export default class Datetime extends React.Component {
// { viewDate, selectedDate, renderYear, isValidDate, navigate, showView, updateDate }
viewProps.renderYear = props.renderYear;
return <YearsView {...viewProps } />;

case viewModes.MONTHS:
// { viewDate, selectedDate, renderMonth, isValidDate, navigate, showView, updateDate }
viewProps.renderMonth = props.renderMonth;
return <MonthsView {...viewProps} />;

case viewModes.DAYS:
// { viewDate, selectedDate, renderDay, isValidDate, navigate, showView, updateDate, timeFormat
// { viewDate, selectedDate, renderDay, isValidDate, navigate, showView, updateDate, timeFormat
viewProps.renderDay = props.renderDay;
viewProps.timeFormat = this.getFormat('time');
return <DaysView {...viewProps} />;

default:
// { viewDate, selectedDate, timeFormat, dateFormat, timeConstraints, setTime, showView }
viewProps.dateFormat = this.getFormat('date');
Expand All @@ -186,7 +186,7 @@ export default class Datetime extends React.Component {
inputValue: this.getInitialInputValue( selectedDate )
};
}

getInitialViewDate( selectedDate ) {
const propDate = this.props.initialViewDate;
let viewDate;
Expand Down Expand Up @@ -251,7 +251,7 @@ export default class Datetime extends React.Component {

return cn;
}

isOpen() {
return !this.props.input || (this.props.open === undefined ? this.state.open : this.props.open);
}
Expand Down Expand Up @@ -305,7 +305,7 @@ export default class Datetime extends React.Component {
else if ( type === 'time' ) {
return this.getTimeFormat();
}

let dateFormat = this.getDateFormat();
let timeFormat = this.getTimeFormat();
return dateFormat && timeFormat ? dateFormat + ' ' + timeFormat : (dateFormat || timeFormat );
Expand Down Expand Up @@ -338,17 +338,17 @@ export default class Datetime extends React.Component {
let updateOnView = this.getUpdateOn( this.getFormat('date') );
let viewDate = this.state.viewDate.clone();

// Set the value into day/month/year
viewDate[ this.viewToMethod[currentView] ](
parseInt( e.target.getAttribute('data-value'), 10 )
);

// Need to set month and year will for days view (prev/next month)
if ( currentView === 'days' ) {
viewDate.month( parseInt( e.target.getAttribute('data-month'), 10 ) );
viewDate.year( parseInt( e.target.getAttribute('data-year'), 10 ) );
}

// Set the value into day/month/year
viewDate[ this.viewToMethod[currentView] ](
parseInt( e.target.getAttribute('data-value'), 10 )
);

let update = {viewDate: viewDate};
if ( currentView === updateOnView ) {
update.selectedDate = viewDate.clone();
Expand All @@ -369,7 +369,7 @@ export default class Datetime extends React.Component {

_viewNavigate = ( modifier, unit ) => {
let viewDate = this.state.viewDate.clone();

// Subtracting is just adding negative time
viewDate.add( modifier, unit );

Expand All @@ -382,10 +382,10 @@ export default class Datetime extends React.Component {

this.setState({viewDate});
}

_setTime = ( type, value ) => {
let date = (this.getSelectedDate() || this.state.viewDate).clone();

date[ type ]( value );

if ( !this.props.value ) {
Expand Down Expand Up @@ -492,7 +492,7 @@ export default class Datetime extends React.Component {
if ( selectedDate && selectedDate.isValid() ) {
update.inputValue = selectedDate.format( this.getFormat('datetime') );
}

this.setState( update );
}

Expand All @@ -506,16 +506,16 @@ export default class Datetime extends React.Component {
const props = this.props;
if ( props.inputProps.value )
return props.inputProps.value;

if ( selectedDate && selectedDate.isValid() )
return selectedDate.format( this.getFormat('datetime') );

if ( props.value && typeof props.value === 'string' )
return props.value;

if ( props.initialValue && typeof props.initialValue === 'string' )
return props.initialValue;

return '';
}

Expand All @@ -536,7 +536,7 @@ export default class Datetime extends React.Component {
};

if ( !date ) return logError();

let viewDate;
if ( typeof date === 'string' ) {
viewDate = this.localMoment(date, this.getFormat('datetime') );
Expand All @@ -551,7 +551,7 @@ export default class Datetime extends React.Component {

/**
* Set the view currently shown by the calendar. View modes shipped with react-datetime are 'years', 'months', 'days' and 'time'.
* @param TYPES.string mode
* @param TYPES.string mode
*/
navigate( mode ) {
this._showView( mode );
Expand Down

0 comments on commit bdf9b01

Please sign in to comment.