Skip to content

Commit

Permalink
Shows the time in the preview event placeholder.
Browse files Browse the repository at this point in the history
  • Loading branch information
dawnerd committed Dec 18, 2014
1 parent 8909cb5 commit 5b3fe10
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
7 changes: 7 additions & 0 deletions less/layout.less
Expand Up @@ -140,7 +140,14 @@
}

.weekly-event-preview {
position: absolute;
padding: 5px;
z-index: 0;

.weekly-event-time {
font-size: 10px;
margin-bottom: 4px;
}
}
}
}
Expand Down
1 change: 1 addition & 0 deletions less/theme-mixin.less
Expand Up @@ -93,6 +93,7 @@

.weekly-event-preview {
background-color: @eventPreviewColor;
color: @eventForegroundColor;
.event-border();
}
}
Expand Down
14 changes: 13 additions & 1 deletion lib/weekly.js
Expand Up @@ -708,7 +708,19 @@
var tempStart = Math.floor(mouseOffsetTop / intervalHeight) * intervalHeight;
var tempEnd = tempStart + minHeight;

target.append('<div class="weekly-event-preview"></div>');
var dateSplit = target.data('date').split('-');

var startTime = ((tempStart / hourHeight) || 0) + this.startTime;
var endTime = ((tempEnd / hourHeight) || 1) + this.startTime;

if(endTime - startTime < this.minDuration / 60) {
endTime = startTime + (this.minDuration / 60);
}

var start = new Date(dateSplit[0], dateSplit[1]-1, dateSplit[2], startTime - this.timezoneOffset, this.fromDecimal(startTime));
var end = new Date(dateSplit[0], dateSplit[1]-1, dateSplit[2], endTime - this.timezoneOffset, this.fromDecimal(endTime));

target.append('<div class="weekly-event-preview"><div class="weekly-event-time">' + dateFormat('%g:%i', start) + ' - ' + dateFormat('%g:%i%a', end) + '</div></div>');
previewEvent = target.find('.weekly-event-preview');

previewEvent.css({
Expand Down

0 comments on commit 5b3fe10

Please sign in to comment.