hedera-web/js/htk/column/date.js

39 lines
586 B
JavaScript
Raw Normal View History

2016-09-26 09:28:47 +00:00
module.exports = new Class
({
Extends: Htk.Column
,Tag: 'htk-column-date'
,Properties:
{
/**
* Format that applies to the value.
2022-05-26 06:08:31 +00:00
*/
format:
{
type: String
2022-05-26 06:08:31 +00:00
,set: function(x) {
this._format = _(x);
}
2022-05-26 06:08:31 +00:00
,get: function() {
return this._format;
}
}
}
,_format: _('%a, %e %b %Y')
2022-05-26 06:08:31 +00:00
,initialize: function(props) {
this._cssClass = 'cell-date';
2022-05-26 06:08:31 +00:00
this.parent(props);
}
2022-05-26 06:08:31 +00:00
,render: function(tr) {
var text = Vn.Date.strftime(this.value, this._format);
2022-05-26 06:08:31 +00:00
var td = this.parent(tr);
td.appendChild(this.createTextNode(text));
return td;
}
});