Closed cwperry closed 8 years ago
Looks good, thanks!
@cwperry I took another look at this, and I'm going to make a few changes. Basically, I'm going to make it behave like this:
showTime: true #always/never show the time (unless it's allDay, in which case don't)
showDate: null #always/never show the date. By default defer to implictDate setting
showYear: null #always/never show the year. By default defer to implictYear setting
implicitMinutes: true #hide minutes if they're 00
implicitDate: false #hide the date if the range takes place entirely today
implicitYear: true #hide the year if range takes place entirely this year
IOW, I found it confusing that while showYear:false
does what it says on the tin, showYear:true
currently means "use the implicitYear setting to decide whether to show the year" whereas I think it ought to me "no really, show the year". I don't think this will break anything, but I wanted to run it past you since you've just used these options.
Actually, here's what I implemented:
hideTime: false
hideYear: false
implicitMinutes: true
implicitDate: false
implicitYear: true
I left in reverse compat:
options.hideTime = !options.showTime if options.showTime?
options.hideYear = !options.showYear if options.showYear?
options.implicitDate = !options.showDate if options.showDate?
Added a showTime formatting option, that when set to false will not show the time components.
For example, using the following:
At the time of creation for my app, I do not know if the two date ranges are all day, so what this change does in the following:
Furthermore, by adding a showYear option, I can hide the year as well: