From e6c8d275d5620ec39c48e900fc35b9b044d03f71 Mon Sep 17 00:00:00 2001
From: Matteo Milesi <mile-23@hotmail.it>
Date: Thu, 01 Feb 2018 20:22:24 +0100
Subject: [PATCH] Use static property defaultProps instead of getDefaultProps. (#496)

---
 DateTime.js |   39 ++++++++++++++++++---------------------
 1 files changed, 18 insertions(+), 21 deletions(-)

diff --git a/DateTime.js b/DateTime.js
index b0a9dad..08dfc6d 100644
--- a/DateTime.js
+++ b/DateTime.js
@@ -32,27 +32,6 @@
 		closeOnTab: TYPES.bool
 	},
 
-	getDefaultProps: function() {
-		var nof = function() {};
-		return {
-			className: '',
-			defaultValue: '',
-			inputProps: {},
-			input: true,
-			onFocus: nof,
-			onBlur: nof,
-			onChange: nof,
-			onViewModeChange: nof,
-			timeFormat: true,
-			timeConstraints: {},
-			dateFormat: true,
-			strictParsing: true,
-			closeOnSelect: false,
-			closeOnTab: true,
-			utc: false
-		};
-	},
-
 	getInitialState: function() {
 		var state = this.getStateFromProps( this.props );
 
@@ -448,6 +427,24 @@
 	}
 });
 
+Datetime.defaultProps = {
+	className: '',
+	defaultValue: '',
+	inputProps: {},
+	input: true,
+	onFocus: function() {},
+	onBlur: function() {},
+	onChange: function() {},
+	onViewModeChange: function() {},
+	timeFormat: true,
+	timeConstraints: {},
+	dateFormat: true,
+	strictParsing: true,
+	closeOnSelect: false,
+	closeOnTab: true,
+	utc: false
+};
+
 // Make moment accessible through the Datetime class
 Datetime.moment = moment;
 

--
Gitblit v1.9.3