ParamQuery

General Category => Help for ParamQuery Pro => Topic started by: omerix on March 20, 2019, 05:16:18 pm

Title: date format
Post by: omerix on March 20, 2019, 05:16:18 pm
Hello,
The format I use: dd/mm/yy  (Day / Month / Year)


Screenshot:
1) Screen: https://yadi.sk/i/AfojWZ48deF0og
2) Filter:  https://yadi.sk/i/zFv9iiTxKqOCdg
3) Click cell:
    3a) Open Calendar: https://yadi.sk/i/BqJqadMNmlTXOA
    3b) Select Date: https://yadi.sk/i/4AVjkWpWNK57Yg ( February 8 )
    3c) After selection: https://yadi.sk/i/MtkGiISOg8xIeA ( August 2 ) The error is here!


This Code:
Code: [Select]
,{title: 'Boya Termin', dataIndx: 'SP_HEDEFTERMIN', width:85,dataType:'date',format:'dd/mm/yy',formatRaw:'dd/mm/yy',editable:true,clsHead:'pqu'
,filter: { crules: [{ condition:'between'}]}
,editor: {type: 'textbox',init: dateEditor}
,render: function (ui) {return {cls:ui.rowData['SP_HEDEFTERMINRENK']};}
}


Code: [Select]
var dateEditor = function (ui) {
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:'dd/mm/yy',
showButtonPanel: true,
changeMonth: true,
changeYear: 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();
}
});
}
Title: Re: date format
Post by: paramvir on March 21, 2019, 05:53:19 pm
I don't see error in the screenshot. Can you provide a jsfiddle/plnkr.

That red triangle in the top left corner denotes dirty cell.
Title: Re: date format
Post by: omerix on May 09, 2019, 03:31:50 pm
Hello Param,

Code:
http://jsfiddle.net/4pvfsmwq/

Data and Cell display:
https://yadi.sk/i/ggx9q0mOdqlg8g


It would be nice if we could save the format for all fields in the lang file.

dateFormat = "dd / mm / yy"
dateFormatFull = "MM / dd / yy"
Title: Re: date format
Post by: arbyter on May 23, 2019, 10:44:59 pm
hi omerix
i found a workround.(quick and dirty). Just declare the date-field as string, then it will accept dd/mm/yyyy format.

{title: "Datum", width: 100, dataType: "string", dataIndx: "datum",format:'dd.mm.yy',formatRaw:'dd.mm.yy',....