diff resources/lib/datetime/UX_DateTimeField.js @ 550:b6875e900e3a

Added datetime library.
author Raimund Renkert <raimund.renkert@intevation.de>
date Fri, 06 Mar 2015 12:44:44 +0100
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/resources/lib/datetime/UX_DateTimeField.js	Fri Mar 06 12:44:44 2015 +0100
@@ -0,0 +1,43 @@
+Ext.define('Ext.ux.form.DateTimeField', {
+	  extend: 'Ext.form.field.Date',
+	  alias: 'widget.datetimefield',
+	  requires: ['Ext.ux.DateTimePicker'],
+
+	  initComponent: function() {
+		  this.format = this.format + ' ' + 'H:i:s';
+		  this.callParent();
+	  },
+	  // overwrite
+	  createPicker: function() {
+		  var me = this,
+			  format = Ext.String.format;
+
+		  return Ext.create('Ext.ux.DateTimePicker', {
+			    ownerCt: me.ownerCt,
+			    renderTo: document.body,
+			    floating: true,
+			    hidden: true,
+			    focusOnShow: true,
+			    minDate: me.minValue,
+			    maxDate: me.maxValue,
+			    disabledDatesRE: me.disabledDatesRE,
+			    disabledDatesText: me.disabledDatesText,
+			    disabledDays: me.disabledDays,
+			    disabledDaysText: me.disabledDaysText,
+			    format: me.format,
+			    showToday: me.showToday,
+			    startDay: me.startDay,
+			    minText: format(me.minText, me.formatDate(me.minValue)),
+			    maxText: format(me.maxText, me.formatDate(me.maxValue)),
+			    listeners: {
+				    scope: me,
+				    select: me.onSelect
+			    },
+			    keyNavConfig: {
+				    esc: function() {
+					    me.collapse();
+				    }
+			    }
+		    });
+	  }
+  });
\ No newline at end of file

http://lada.wald.intevation.org