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