General Category > Suggest new features

general date format

(1/1)

omerix:
Hello,

Are you considering adding a general date format to the "options" sections?


--- Code: ---var obj = {
     editable:true
    ,dateFormat:'dd/mm/yyyy' /*Other: 'dd.mm' , 'dd/mm/yyyy' */
}

--- End code ---


1) This should come when editing manually. (dd/mm/yyyy)
2) It should come when choosing from the calendar. (dd/mm/yyyy)
3) It must be displayed in this format when it is displayed. (dd/mm/yyyy)






--- Code: ---,{title:'Tarih',dataIndx:'TARIH1',dataType:'date',minWidth:24,width:85,cls:'',clsHead:'',align:'',halign:'center',hidden:false,editable:true
,editor: {type: 'textbox',init: HucreT},format:'dd/mm/yy',formatRaw:'yy-mm-dd',formatSel:'yy-mm-dd'
,filter: { crules: [{ condition:'between'}],menuIcon:false}
,render: function (ui) {return {attr:'title="'+ui.cellData+'"'} }
}

--- End code ---



--- Code: ---var HucreT = function (ui) {
var formatSel = ui.column.formatSel || 'dd/mm/yy';
//console.log(formatSel);

var $inp = ui.$cell.find("input"),               
grid = this,
validate = function (that) {
var valid = grid.isValid({
dataIndx: ui.dataIndx,
value: $inp.val(),
rowIndx: ui.rowIndx
}).valid;
if (!valid) {
that.firstOpen = false;
}
};

//initialize the editor
$inp
.on("input", function (evt) {
/*validate(this);*/
})
.datepicker({
dateFormat:formatSel
,defaultDate: null
,changeMonth: true
,showButtonPanel: true
,changeYear: true
,showWeek: true
,showOtherMonths: true
,selectOtherMonths: true
,showAnim: ''
,onSelect: function () {
this.firstOpen = true;
/*validate(this);*/
}
,beforeShow: function (input, inst) {
setTimeout(function(){
//to fix the issue of datepicker z-index when grid is in maximized state.
$('.ui-datepicker').css('z-index', 999999999999);
});
return !this.firstOpen;
}
,onClose: function () {
this.focus();
}
});
};

--- End code ---

Attachments: https://yadi.sk/i/LNcPRP_A_E189w

Navigation

[0] Message Index

Go to full version