picyka Posted February 4, 2022 Author Share Posted February 4, 2022 procedure TUniMainModule.UniGUIMainModuleNewComponent(AComponent: TComponent); begin if AComponent is TfrxReport then (AComponent as TfrxReport).EngineOptions.UseGlobalDataSetList := False else if AComponent is TUniCustomDateTimePicker then TUniDateTimePicker(AComponent).ConfigureFormatDate <<<<<<------- else if AComponent is TUniDBGrid then begin TUniDBGrid(AComponent).ConfirureOpacity; TUniDBGrid(AComponent).ConfigureZebra; end; end; Quote Link to comment Share on other sites More sharing options...
picyka Posted February 4, 2022 Author Share Posted February 4, 2022 há 1 hora, picyka disse: Sim, é usado também. function beforeInit(sender, config) { config.altFormats="dmY|d/m/Y|j/n/Y|j/n/y|j/m/y|d/m/y|j/m/Y|d/n/Y|d-m-y|d-m-Y|d/m|d-m|dm|dmy|dmY|d|d-m-Y|j-n|j/n"; config.selectMonth = null; config.createPicker = function() { var me = this, format = Ext.String.format; return Ext.create('Ext.picker.Month', { pickerField: me, 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: { select: { scope: me, fn: me.onSelect }, monthdblclick: { scope: me, fn: me.onOKClick }, yeardblclick: { scope: me, fn: me.onOKClick }, OkClick: { scope: me, fn: me.onOKClick }, CancelClick: { scope: me, fn: me.onCancelClick } }, keyNavConfig: { esc: function() { me.collapse(); } } }); }; config.onCancelClick = function() { var me = this; me.selectMonth = null; me.collapse(); }; config.onOKClick = function() { var me = this; if (me.selectMonth) { me.setValue(me.selectMonth); me.fireEvent('select', me, me.selectMonth); } me.collapse(); }; config.onSelect = function(m, d) { var me = this; me.selectMonth = new Date((d[0] + 1) + '/1/' + d[1]); }; } Quote Link to comment Share on other sites More sharing options...
picyka Posted February 4, 2022 Author Share Posted February 4, 2022 Just now, picyka said: function beforeInit(sender, config) { config.altFormats="dmY|d/m/Y|j/n/Y|j/n/y|j/m/y|d/m/y|j/m/Y|d/n/Y|d-m-y|d-m-Y|d/m|d-m|dm|dmy|dmY|d|d-m-Y|j-n|j/n"; config.selectMonth = null; config.createPicker = function() { var me = this, format = Ext.String.format; return Ext.create('Ext.picker.Month', { pickerField: me, 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: { select: { scope: me, fn: me.onSelect }, monthdblclick: { scope: me, fn: me.onOKClick }, yeardblclick: { scope: me, fn: me.onOKClick }, OkClick: { scope: me, fn: me.onOKClick }, CancelClick: { scope: me, fn: me.onCancelClick } }, keyNavConfig: { esc: function() { me.collapse(); } } }); }; config.onCancelClick = function() { var me = this; me.selectMonth = null; me.collapse(); }; config.onOKClick = function() { var me = this; if (me.selectMonth) { me.setValue(me.selectMonth); me.fireEvent('select', me, me.selectMonth); } me.collapse(); }; config.onSelect = function(m, d) { var me = this; me.selectMonth = new Date((d[0] + 1) + '/1/' + d[1]); }; } I put it on the first line, but it doesn't resolve yet. Quote Link to comment Share on other sites More sharing options...
picyka Posted February 4, 2022 Author Share Posted February 4, 2022 config.altFormats="dmY|d/m/Y|j/n/Y|j/n/y|j/m/y|d/m/y|j/m/Y|d/n/Y|d-m-y|d-m-Y|d/m|d-m|dm|dmy|dmY|d|d-m-Y|j-n|j/n"; If I understand you, I would have to change this setting to work with mm/yyyy that? Quote Link to comment Share on other sites More sharing options...
picyka Posted February 4, 2022 Author Share Posted February 4, 2022 13 minutos atrás, picyka disse: config.altFormats="dmY|d/m/Y|j/n/Y|j/n/y|j/m/y|d/m/y|j/m/Y|d/n/Y|d-| m-Y|d/m|d-m|dm|dmy|dmY|d|d-m-Y|j-n|j/n"; Se eu te entendesse, eu teria que mudar essa configuração para trabalhar com mm/yyyyy isso? config.altFormats="mY|m/Y|j/n/Y|j/n/y|j/m/y|m/y|j/m/Y|n/Y|m-y|m-Y|m|| meu|m-Y|j-n|j/n"; In this format it is almost 100% perfect, only the month I always have to inform two digits ex: 02/2022 if I type just 2 it doesn't get 02/2022 Quote Link to comment Share on other sites More sharing options...
Sherzod Posted February 5, 2022 Share Posted February 5, 2022 8 hours ago, picyka said: only the month I always have to inform two digits ex: 02/2022 if I type just 2 it doesn't get 02/2022 Hello, Try use j instead of m. For example: jY 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.