hi all, I''ve built a simple javascript datepicker for use with Rails. I''m sure others exist, but think this one is quite decent without being overengineered. http://projects.exactlyoneturtle.com/date_picker/ At present there''s no Rails HTML generator method for it; later I will package it in a script/generator, but for now it is quite easy to use with Rails and doesn''t require much HTML in the page; it does not contaminate params with extra junk and supports multiple datepickers on the same page. I hope some of you find it useful. Please CC me directly on any feedback. -- cheers, David Lee (davelee @ freenode #rubyonrails) -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails-spinoffs/attachments/20050919/39a8cef7/attachment.html
Ezra Zygmuntowicz
2005-Sep-19 23:33 UTC
[Rails-spinoffs] Rails compatible JS datepicker -- beta
_very nice_ Thanks -Ezra On Sep 19, 2005, at 7:58 PM, David Lee wrote:> hi all, > > I''ve built a simple javascript datepicker for use with Rails. I''m > sure others exist, but think this one is quite decent without being > overengineered. > > http://projects.exactlyoneturtle.com/date_picker/ > > At present there''s no Rails HTML generator method for it; later I > will package it in a script/generator, but for now it is quite easy > to use with Rails and doesn''t require much HTML in the page; it > does not contaminate params with extra junk and supports multiple > datepickers on the same page. > > I hope some of you find it useful. Please CC me directly on any > feedback. > -- > cheers, > David Lee > > (davelee @ freenode #rubyonrails) > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >-Ezra Zygmuntowicz WebMaster Yakima Herald-Republic Newspaper ezra@yakima-herald.com 509-577-7732 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails-spinoffs/attachments/20050919/f825022b/attachment.html
Alan Gutierrez
2005-Sep-19 23:38 UTC
[Rails-spinoffs] Rails compatible JS datepicker -- beta
* David Lee <deathtoallfanatics@gmail.com> [2005-09-19 22:59]:> hi all, > > I''ve built a simple javascript datepicker for use with Rails. I''m sure > others exist, but think this one is quite decent without being > overengineered. > > http://projects.exactlyoneturtle.com/date_picker/ > > At present there''s no Rails HTML generator method for it; later I will > package it in a script/generator, but for now it is quite easy to use with > Rails and doesn''t require much HTML in the page; it does not contaminate > params with extra junk and supports multiple datepickers on the same page. > > I hope some of you find it useful. Please CC me directly on any feedback.Very cool. Thank you. -- Alan Gutierrez - alan@engrm.com - http://engrm.com/blogometer/index.html - http://engrm.com/blogometer/rss.2.0.xml
Maninder, Singh
2005-Sep-20 01:51 UTC
[Rails-spinoffs] Rails compatible JS datepicker -- beta
Very cool...Thanks so much :) p.s. Does anyone know where you can search this mailing list? If I need to go through the archives to check for earlier questions... -----Original Message----- From: rails-spinoffs-bounces@lists.rubyonrails.org [mailto:rails-spinoffs-bounces@lists.rubyonrails.org]On Behalf Of David Lee Sent: Tuesday, September 20, 2005 8:29 AM To: Rails-spinoffs@lists.rubyonrails.org Subject: [Rails-spinoffs] Rails compatible JS datepicker -- beta hi all, I''ve built a simple javascript datepicker for use with Rails. I''m sure others exist, but think this one is quite decent without being overengineered. http://projects.exactlyoneturtle.com/date_picker/ At present there''s no Rails HTML generator method for it; later I will package it in a script/generator, but for now it is quite easy to use with Rails and doesn''t require much HTML in the page; it does not contaminate params with extra junk and supports multiple datepickers on the same page. I hope some of you find it useful. Please CC me directly on any feedback. -- cheers, David Lee (davelee @ freenode #rubyonrails) -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails-spinoffs/attachments/20050920/e05f6726/attachment.html
Andrew Kaspick
2005-Sep-20 08:08 UTC
[Rails-spinoffs] Rails compatible JS datepicker -- beta
Some sort way to "cancel" selection would be nice. If I bring up the datepicker and either don''t want to select a date or I''ve navigated away from my original date and want to revert back to my originally selected date. You could either use a small "button" area or simply clicking off the datepicker cancels the operation. Looks good though. On 9/19/05, David Lee <deathtoallfanatics@gmail.com> wrote:> hi all, > > I''ve built a simple javascript datepicker for use with Rails. I''m sure > others exist, but think this one is quite decent without being > overengineered. > > http://projects.exactlyoneturtle.com/date_picker/ > > At present there''s no Rails HTML generator method for it; later I will > package it in a script/generator, but for now it is quite easy to use with > Rails and doesn''t require much HTML in the page; it does not contaminate > params with extra junk and supports multiple datepickers on the same page. > > I hope some of you find it useful. Please CC me directly on any feedback. > -- > cheers, > David Lee > > (davelee @ freenode #rubyonrails) > > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > >
good idea Andrew, though it uses the one hidden field to track the calendar''s state as it seemed the simplest thing that could work (and didn''t require an extra hidden field). I''d need to store the state (or originally selected date) elsewhere for this to work. Maybe a hidden field inside the JS-generated HTML ... The javascript object is essentially a singleton too, so I''ll have to think about how to implement this. If anyone''s got an idea on how to make it close on ''clickElsewhere'' please let me know. I might be able to manage it on rollOut ... cheers D PS - clicking the datepicker link will toggle the calendar shut if its open, but that''s not quite a cancel as the currently selected date persists. On 9/20/05, Andrew Kaspick <akaspick@gmail.com> wrote:> > Some sort way to "cancel" selection would be nice. If I bring up the > datepicker and either don''t want to select a date or I''ve navigated > away from my original date and want to revert back to my originally > selected date. > > You could either use a small "button" area or simply clicking off the > datepicker cancels the operation. > > Looks good though. > > On 9/19/05, David Lee <deathtoallfanatics@gmail.com> wrote: > > hi all, > > > > I''ve built a simple javascript datepicker for use with Rails. I''m sure > > others exist, but think this one is quite decent without being > > overengineered. > > > > http://projects.exactlyoneturtle.com/date_picker/ > > > > At present there''s no Rails HTML generator method for it; later I will > > package it in a script/generator, but for now it is quite easy to use > with > > Rails and doesn''t require much HTML in the page; it does not contaminate > > params with extra junk and supports multiple datepickers on the same > page. > > > > I hope some of you find it useful. Please CC me directly on any > feedback. > > -- > > cheers, > > David Lee > > > > (davelee @ freenode #rubyonrails) > > > > _______________________________________________ > > Rails-spinoffs mailing list > > Rails-spinoffs@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > > > > > >-- cheers, David Lee -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails-spinoffs/attachments/20050920/2d67b26d/attachment-0001.html
David Lee wrote:> good idea Andrew, > > though it uses the one hidden field to track the calendar''s state as it > seemed the simplest thing that could work (and didn''t require an extra > hidden field). I''d need to store the state (or originally selected date) > elsewhere for this to work. Maybe a hidden field inside the > JS-generated HTML ...If I''m not mistaken, the form field''s defaultValue property should contain the original value assigned to the field. So perhaps you can use that property if you need to make local comparisons, such as has the user selected a date in the future. Unless of course you need to submit both the currenlty slected date and the previous date. Danilo
actually that was easier than i expected - there''s now a cancel button in the current version at projects.exactlyoneturtle.com/date_picker/<http://projects.exactlyoneturtle.com/date_picker/>, and a config option for it in the .js thanks for the idea -- I''ll take a look at ''onroll / clickout'' cancellation tomorrow cheers D On 9/20/05, Andrew Kaspick <akaspick@gmail.com> wrote:> > Some sort way to "cancel" selection would be nice. If I bring up the > datepicker and either don''t want to select a date or I''ve navigated > away from my original date and want to revert back to my originally > selected date. > > You could either use a small "button" area or simply clicking off the > datepicker cancels the operation. > > Looks good though. > > On 9/19/05, David Lee <deathtoallfanatics@gmail.com> wrote: > > hi all, > > > > I''ve built a simple javascript datepicker for use with Rails. I''m sure > > others exist, but think this one is quite decent without being > > overengineered. > > > > http://projects.exactlyoneturtle.com/date_picker/ > > > > At present there''s no Rails HTML generator method for it; later I will > > package it in a script/generator, but for now it is quite easy to use > with > > Rails and doesn''t require much HTML in the page; it does not contaminate > > params with extra junk and supports multiple datepickers on the same > page. > > > > I hope some of you find it useful. Please CC me directly on any > feedback. > > -- > > cheers, > > David Lee > > > > (davelee @ freenode #rubyonrails) > > > > _______________________________________________ > > Rails-spinoffs mailing list > > Rails-spinoffs@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > > > > > >-- cheers, David Lee -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails-spinoffs/attachments/20050920/51ea8fe5/attachment-0001.html
Andrew Kaspick
2005-Sep-20 11:32 UTC
[Rails-spinoffs] Rails compatible JS datepicker -- beta
Nice! Awesome turn around time with the feature request. ;) Andrew On 9/20/05, David Lee <deathtoallfanatics@gmail.com> wrote:> actually that was easier than i expected - there''s now a cancel button in > the current version at > projects.exactlyoneturtle.com/date_picker/ , and a config > option for it in the .js > > thanks for the idea -- I''ll take a look at ''onroll / clickout'' cancellation > tomorrow > > cheers > D > > > > > On 9/20/05, Andrew Kaspick < akaspick@gmail.com> wrote: > > Some sort way to "cancel" selection would be nice. If I bring up the > > datepicker and either don''t want to select a date or I''ve navigated > > away from my original date and want to revert back to my originally > > selected date. > > > > You could either use a small "button" area or simply clicking off the > > datepicker cancels the operation. > > > > Looks good though. > > > > On 9/19/05, David Lee <deathtoallfanatics@gmail.com> wrote: > > > > > hi all, > > > > > > I''ve built a simple javascript datepicker for use with Rails. I''m sure > > > others exist, but think this one is quite decent without being > > > overengineered. > > > > > > http://projects.exactlyoneturtle.com/date_picker/ > > > > > > At present there''s no Rails HTML generator method for it; later I will > > > package it in a script/generator, but for now it is quite easy to use > with > > > Rails and doesn''t require much HTML in the page; it does not contaminate > > > params with extra junk and supports multiple datepickers on the same > page. > > > > > > I hope some of you find it useful. Please CC me directly on any > feedback. > > > -- > > > cheers, > > > David Lee > > > > > > (davelee @ freenode #rubyonrails) > > > > > > _______________________________________________ > > > Rails-spinoffs mailing list > > > Rails-spinoffs@lists.rubyonrails.org > > > > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > > > > > > > > > > > > > > -- > cheers, > David Lee
Laurie Harper
2005-Sep-20 14:25 UTC
[Rails-spinoffs] Rails compatible JS datepicker -- beta
Just a suggestion, but couldn''t you store the state of the date picker (and the starting (previously selected) date too, for that matter) on the date picker itself? Does the date picker''s state really need to round-trip through the server? L. On 20-Sep-05, at 10:25 AM, David Lee wrote:> good idea Andrew, > > though it uses the one hidden field to track the calendar''s state > as it seemed the simplest thing that could work (and didn''t require > an extra hidden field). I''d need to store the state (or originally > selected date) elsewhere for this to work. Maybe a hidden field > inside the JS-generated HTML ... > > The javascript object is essentially a singleton too, so I''ll have > to think about how to implement this. > > If anyone''s got an idea on how to make it close on ''clickElsewhere'' > please let me know. I might be able to manage it on rollOut ... > > cheers > D > > PS - clicking the datepicker link will toggle the calendar shut if > its open, but that''s not quite a cancel as the currently selected > date persists. > > On 9/20/05, Andrew Kaspick <akaspick@gmail.com> wrote: > Some sort way to "cancel" selection would be nice. If I bring up the > datepicker and either don''t want to select a date or I''ve navigated > away from my original date and want to revert back to my originally > selected date. > > You could either use a small "button" area or simply clicking off the > datepicker cancels the operation. > > Looks good though. > > On 9/19/05, David Lee < deathtoallfanatics@gmail.com> wrote: > > hi all, > > > > I''ve built a simple javascript datepicker for use with Rails. > I''m sure > > others exist, but think this one is quite decent without being > > overengineered. > > > > http://projects.exactlyoneturtle.com/date_picker/ > > > > At present there''s no Rails HTML generator method for it; later > I will > > package it in a script/generator, but for now it is quite easy to > use with > > Rails and doesn''t require much HTML in the page; it does not > contaminate > > params with extra junk and supports multiple datepickers on the > same page. > > > > I hope some of you find it useful. Please CC me directly on any > feedback. > > -- > > cheers, > > David Lee > > > > (davelee @ freenode #rubyonrails) > > > > _______________________________________________ > > Rails-spinoffs mailing list > > Rails-spinoffs@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > > > > > > > > > -- > cheers, > David Lee > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >-- Laurie Harper Open Source advocate, Java geek: http://www.holoweb.net/laurie Founder, Zotech Software: http://www.zotechsoftware.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails-spinoffs/attachments/20050920/c652efd2/attachment-0001.html