Add new type for date widget to show only time(in today range)/date

This commit is contained in:
Hadi Nategh 2015-11-12 15:46:56 +00:00
parent 0077befe25
commit 07681364f8

View File

@ -971,12 +971,17 @@ var et2_date_ro = et2_valueWidget.extend([et2_IDetachedDOM],
var display = this.date.toString();
switch(this._type) {
case "time_or_date":
case "date-time_today":
// Today - just the time
if(date('Y-m-d', this.date) == date('Y-m-d'))
{
display = date(this.egw().preference('timeformat') == '24' ? 'H:i' : 'g:i a', this.date);
}
else if (this._type === "time_or_date")
{
display = date(this.egw().preference('dateformat'), this.date);
}
// Before today - date and time
else
{
@ -1087,7 +1092,7 @@ var et2_date_ro = et2_valueWidget.extend([et2_IDetachedDOM],
}
}
});
et2_register_widget(et2_date_ro, ["date_ro", "date-time_ro", "date-since", "date-time_today"]);
et2_register_widget(et2_date_ro, ["date_ro", "date-time_ro", "date-since", "date-time_today", "time_or_date"]);
/**
* @augments et2_date_ro