mirror of
https://github.com/alextselegidis/easyappointments.git
synced 2024-12-22 22:52:35 +03:00
Avoid displaying the date in the column container when the user is on single day view.
This commit is contained in:
parent
4b976c86fe
commit
7ed43cdad2
1 changed files with 9 additions and 5 deletions
|
@ -401,6 +401,7 @@ window.BackendCalendarTableView = window.BackendCalendarTableView || {};
|
|||
function _createView(startDate, endDate) {
|
||||
$('#calendar .calendar-view').remove();
|
||||
|
||||
var displayDate = startDate.getTime() !== endDate.getTime();
|
||||
var $calendarView = $('<div class="calendar-view" />').appendTo('#calendar');
|
||||
|
||||
$calendarView.data({
|
||||
|
@ -419,7 +420,7 @@ window.BackendCalendarTableView = window.BackendCalendarTableView || {};
|
|||
var currentDate = startDate;
|
||||
|
||||
while(currentDate <= endDate) {
|
||||
_createDateColumn($wrapper, currentDate, response);
|
||||
_createDateColumn($wrapper, currentDate, response, displayDate);
|
||||
currentDate.add({days: 1});
|
||||
}
|
||||
|
||||
|
@ -436,13 +437,16 @@ window.BackendCalendarTableView = window.BackendCalendarTableView || {};
|
|||
* @param {jQuery} $wrapper The wrapper div element of the table view.
|
||||
* @param {Date} date Selected date for the column.
|
||||
* @param {Object[]} events Events to be displayed on this date.
|
||||
* @param {Boolean} displayDate Whether to display the date in the column container.
|
||||
*/
|
||||
function _createDateColumn($wrapper, date, events) {
|
||||
function _createDateColumn($wrapper, date, events, displayDate) {
|
||||
var $dateColumn = $('<div class="date-column" />').appendTo($wrapper);
|
||||
|
||||
$dateColumn
|
||||
.data('date', date.getTime())
|
||||
.append('<h5>' + GeneralFunctions.formatDate(date, GlobalVariables.dateFormat) + '</h5>');
|
||||
$dateColumn.data('date', date.getTime());
|
||||
|
||||
if (displayDate) {
|
||||
$dateColumn.append('<h5>' + GeneralFunctions.formatDate(date, GlobalVariables.dateFormat) + '</h5>');
|
||||
}
|
||||
|
||||
var providers = GlobalVariables.availableProviders;
|
||||
|
||||
|
|
Loading…
Reference in a new issue