Hi
I've define sane as DatePicker a MonthPicker and theres declined components
like datePicker monthPicker retruen a date: the first day of month. support minDate and MaxDate but no yet disabled values.
Ext.MonthPicker

/**
* @class Ext.form.MonthField
* @extends Ext.form.TriggerField
* Provides a date input field with a {@link Ext.MonthPicker} dropdown and automatic date validation.
* @constructor
* Create a new MonthField
* @param {Object} config
*/
Ext.form.MonthField = Ext.extend(Ext.form.TriggerField, {
/**
* @cfg {String} format
* The default date format string which can be overriden for localization support. The format must be
* valid according to {@link Date#parseDate} (defaults to 'm/d/Y').
*/
format : "m/01/Y",
/**
* @cfg {String} altFormats
* Multiple date formats separated by "|" to try when parsing a user input value and it doesn't match the defined
* format (defaults to 'm/d/Y|n/j/Y|n/j/y|m/j/y|n/d/y|m/j/Y|n/d/Y|m-d-y|m-d-Y|m/d|m-d|md|mdy|mdY|d|Y-m-d').
*/
altFormats : "m/Y|m-Y|mY|m/01/Y|m-01-Y|m01Y|m/d/Y|n/j/Y|n/j/y|m/j/y|n/d/y|m/j/Y|n/d/Y|m-d-y|m-d-Y|m/d|m-d|md|mdy|mdY|d|Y-m-d",
/**
* @cfg {String} disabledDaysText
* The tooltip to display when the date falls on a disabled day (defaults to 'Disabled')
*/
disabledDaysText : "Disabled",
/**
* @cfg {String} disabledDatesText
* The tooltip text to display when the date falls on a disabled date (defaults to 'Disabled')
*/
disabledDatesText : "Disabled",
/**
* @cfg {String} minText
* The error text to display when the date in the cell is before minValue (defaults to
* 'The date in this field must be after {minValue}').
*/
minText : "The date in this field must be equal to or after {0}",
/**
* @cfg {String} maxText
* The error text to display when the date in the cell is after maxValue (defaults to
* 'The date in this field must be before {maxValue}').
*/
maxText : "The date in this field must be equal to or before {0}",
/**
* @cfg {String} invalidText
* The error text to display when the date in the field is invalid (defaults to
* '{value} is not a valid date - it must be in the format {format}').
*/
invalidText : "{0} is not a valid date - it must be in the format {1}",
/**
* @cfg {String} triggerClass
* An additional CSS class used to style the trigger button. The trigger will always get the
* class 'x-form-trigger' and triggerClass will be <b>appended</b> if specified (defaults to 'x-form-date-trigger'
* which displays a calendar icon).
*/
triggerClass : 'x-form-date-trigger',
/**
* @cfg {Date/String} minValue
* The minimum allowed date. Can be either a Javascript date object or a string date in a
* valid format (defaults to null).
*/
/**
* @cfg {Date/String} maxValue
* The maximum allowed date. Can be either a Javascript date object or a string date in a
* valid format (defaults to null).
*/
/* * Not implemented yet
* @cfg {Array} disabledDays
* An array of days to disable, 0 based. For example, [0, 6] disables Sunday and Saturday (defaults to null).
*/
/* * Not implemented yet
* @cfg {Array} disabledDates
* An array of "dates" to disable, as strings. These strings will be used to build a dynamic regular
* expression so they are very powerful. Some examples:
* <ul>
* <li>["03/08/2003", "09/16/2003"] would disable those exact dates</li>
* <li>["03/08", "09/16"] would disable those days for every year</li>
* <li>["^03/08"] would only match the beginning (useful if you are using short years)</li>
* <li>["03/../2006"] would disable every day in March 2006</li>
* <li>["^03"] would disable every day in every March</li>
* </ul>
* Note that the format of the dates included in the array should exactly match the {@link #format} config.
* In order to support regular expressions, if you are using a date format that has "." in it, you will have to
* escape the dot when restricting dates. For example: ["03\\.08\\.03"].
*/
/**
* @cfg {String/Object} autoCreate
* A DomHelper element spec, or true for a default element spec (defaults to
* {tag: "input", type: "text", size: "10", autocomplete: "off"})
*/

/**
* Sets the value of the date field. You can pass a date object or any string that can be parsed into a valid
* date, using MonthField.format as the date format, according to the same rules as {@link Date#parseDate}
* (the default format used is "m/d/Y").
* <br />Usage:
* <pre><code>
//All of these calls set the same date value (May 4, 2006)

I'm new in using GWT, and i would like to do a month picker, but i don't know how i am gonna do it, because i can't change the datePicker....

Could you give me some lights how to do it?

Thanks in advance,

Pretender

barmat.ali

29 Apr 2010, 7:09 AM

Is there any way to set the default day to 1 ,
example :

It's march 29 2010, if i select february 2010, in the field.getValue(), i have March 1, 2010 ...

almercog

26 Nov 2010, 8:53 AM

Hello sekaijin,
I'm almost new with GWT, specifically GXT and i want to get this MonthField, is there any way to set dateField to show me like your screenchot or I have to implement a MonthField anyway??

thnks in advance.

lukasw44

9 Jul 2011, 12:42 PM

Hello i try to use this MonthPicker and i have got error :

26927

I use this picker in panel. monthPicker show but i have got error g is undefined ??
plz help