Ticket #7479 (closed enhancement: wontfix)

Opened 4 years ago

Last modified 4 years ago

datepicker: support for Broadcast Calendar

Reported by: brightgarden Owned by:
Priority: minor Milestone: 1.9.0
Component: ui.datepicker Version: 1.8.13
Keywords: Cc:
Blocking: Blocked by:

Description

This is not a bug. I have a change, which I will attempt to commit. The gist is this: I need a broadcast calendar. See:  http://en.wikipedia.org/wiki/Broadcast_calendar

It's pretty simple, and the datepicker does almost everything I need out of the box. I just have two main issues:

  1. I need to suppress rendering the last week if it includes days from the next month.
  2. If the selected date is not in the current month (i.e., August 31, 2011 is actually in "September" on the broadcast calendar), then it should initially open on the correct month.

I'll commit my modification, but of course, if there's a better way, I would love to hear it/use it.

Change History

comment:1 follow-up: ↓ 3 Changed 4 years ago by scott.gonzalez

  • Status changed from new to closed
  • Resolution set to wontfix

This shouldn't be part of the datepicker, but should be possible to build on top of the datepicker. This likely won't be easy until the rewrite. I've left a  comment on the planning wiki to make sure we cover this use case during the rewrite.

comment:2 Changed 4 years ago by brightgarden

ok. that's fine. can't wait for the rewrite. I won't submit the pull request.

 https://github.com/brightgarden/jquery-ui/blob/00851c3ab9631af2ac5a8c5fa6ad2d1c4dafb4fc/ui/jquery.ui.datepicker.js

comment:3 in reply to: ↑ 1 Changed 4 years ago by brightgarden

Replying to scott.gonzalez:

This shouldn't be part of the datepicker, but should be possible to build on top of the datepicker. This likely won't be easy until the rewrite. I've left a  comment on the planning wiki to make sure we cover this use case during the rewrite.

Thanks. I saw the comment on the wiki. And I do think the globalization plugin is a good way to look (I modified the regional settings in my edit).

I can do a hacky extend to make my calendar work, but it still requires a couple of key lines to be inserted to properly calculate the number of rows to display.

Our project stays on top of the latest plugins, so I was hoping to submit a fix so that my modification didn't have to be re-done with each new update.

  • Maggie

comment:4 follow-up: ↓ 5 Changed 4 years ago by scott.gonzalez

Maggie: If there's a simple refactoring of one or two methods in the existing code that would make it possible for you to build your extension in a clean way, I wouldn't be against landing that now. I just don't want to be adding features or making large changes.

comment:5 in reply to: ↑ 4 Changed 4 years ago by brightgarden

Replying to scott.gonzalez:

Maggie: If there's a simple refactoring of one or two methods in the existing code that would make it possible for you to build your extension in a clean way, I wouldn't be against landing that now. I just don't want to be adding features or making large changes.

Ah, actually there is. The bare minimum I need is a way to allow the number of rows to be one less. I implemented it using a new option "showTrailingWeek"--a name I am not in love with.

If you look at my commit, it would be 3 lines: 59, 1483, 1523.

 https://github.com/brightgarden/jquery-ui/commit/00851c3ab9631af2ac5a8c5fa6ad2d1c4dafb4fc

I can definitely do an hacky extend to do the rest. I tried to extend generateHtml, and I can still try, but it would be gross and disgusting. Let me know what you think.

Thanks for replying.

Note: See TracTickets for help on using tickets.