Skip to content

Commit

Permalink
Merge pull request #1373 from jannekalliola/develop
Browse files Browse the repository at this point in the history
Calendar: Absolute dates do not show absolute even if getRelative and urgency are set to zero
  • Loading branch information
MichMich authored Aug 16, 2018
2 parents a696534 + 7c5e8a6 commit b13d0aa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).

### Fixed
- Mixup between german and spanish translation for newsfeed.
- Fixed close dates to be absolute, if no configured in the config.js - module Calendar

### Updated

Expand Down
8 changes: 6 additions & 2 deletions modules/default/calendar/calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,12 @@ Module.register("calendar", {
// If event is within 6 hour, display 'in xxx' time format or moment.fromNow()
timeWrapper.innerHTML = this.capFirst(moment(event.startDate, "x").fromNow());
} else {
// Otherwise just say 'Today/Tomorrow at such-n-such time'
timeWrapper.innerHTML = this.capFirst(moment(event.startDate, "x").calendar());
if(this.config.timeFormat === "absolute") {
timeWrapper.innerHTML = this.capFirst(moment(event.startDate, "x").format(this.config.dateFormat));
} else {
// Otherwise just say 'Today/Tomorrow at such-n-such time'
timeWrapper.innerHTML = this.capFirst(moment(event.startDate, "x").calendar());
}
}
} else {
/* Check to see if the user displays absolute or relative dates with their events
Expand Down

0 comments on commit b13d0aa

Please sign in to comment.