Legacy support as a Rails 3.1+ Engine.
This gem is no longer maintained, use at your own risk. Enquire if you want to take over maintenance. In the meanwhile, obviously good PRs might be merged in, but don't expect anybody to fix bugs.
A previously popular but no longer maintained JavaScript DatePicker for RubyOnRails (and others)
Home Page: http://code.google.com/p/calendardateselect/
License: Other
We are using Asset Packager to compress our CSS and Javascript files. This is a great plus since it allows us to transmit only one compressed CSS and JS file, instead of (altogether) 27 files with each request.
However, when I include CDS's .js files in asset_packager's config/asset_packages.yml, I get the following error upon clicking on a calendar icon:
"'that' is not a function", in initCalendarDiv
It seems that something that asset_packager does, breaks CDS's javascript. What could that be?
Kindly help me,how to use calendar_date_select gem in rails 4 application.
For example, In one form I use LiveValidation to validate the dates. This JS creates a span after the input. Then when I click to launch the date picker, the JS errors because $(this).previous is the span and not the expected input element.
Solution: use the unique ID to identify the input field.
When I select it, October 16th is shown. It only happens in 2010, 2009 and 2011 works fine.
Thank you,
Fred
The cell assigned the "today" class (and consequently surrounded with a broken border) is consistently the previous day, not the current one. This behavior occurs regularly on Ubuntu Linux with Firefox and Google Chrome.
The issue is the Date.daysDistance method, which needs to call Math.ceil instead of Math.round.
Discovered by Nick Murphy at Saturn Systems: http://www.saturnsys.com/
Put "December 10, 2010" in your text field that is connected to the javascript calendar. Then hit the calendar.
Get browser/js error: this.date.getFullYear is not a function
The bug is in the Date.parseFormattedString() call on line 338.
It returns a non-date object for the value we're providing it (looks to be an integer).
The result isn't handled so it passes through as an error and the calendar no longer pops up in this case.
However, if you just type "garbage" in the text field, the javascript calendar continues to popup.
Version 1.16.1.
This gem with Rails 4.2 is failing with the following error:
undefined method `options_for_javascript' for #<#<Class:0x007f0c22c01540>:0x007f0c22c04740> (ActionView::Template::Error)
I could be wrong, but it seems this method has been removed in Rails 4 (http://apidock.com/rails/ActionView/Helpers/UrlHelper/options_for_javascript).
RubyGems.org doesn't report a license for your gem. This is because it is not specified in the gemspec of your last release.
via e.g.
spec.license = 'MIT'
# or
spec.licenses = ['MIT', 'GPL-2']
Including a license in your gemspec is an easy way for rubygems.org and other tools to check how your gem is licensed. As you can image, scanning your repository for a LICENSE file or parsing the README, and then attempting to identify the license or licenses is much more difficult and more error prone. So, even for projects that already specify a license, including a license in your gemspec is a good practice. See, for example, how rubygems.org uses the gemspec to display the rails gem license.
There is even a License Finder gem to help companies/individuals ensure all gems they use meet their licensing needs. This tool depends on license information being available in the gemspec. This is an important enough issue that even Bundler now generates gems with a default 'MIT' license.
I hope you'll consider specifying a license in your gemspec. If not, please just close the issue with a nice message. In either case, I'll follow up. Thanks for your time!
Appendix:
If you need help choosing a license (sorry, I haven't checked your readme or looked for a license file), GitHub has created a license picker tool. Code without a license specified defaults to 'All rights reserved'-- denying others all rights to use of the code.
Here's a list of the license names I've found and their frequencies
p.s. In case you're wondering how I found you and why I made this issue, it's because I'm collecting stats on gems (I was originally looking for download data) and decided to collect license metadata,too, and make issues for gemspecs not specifying a license as a public service :). See the previous link or my blog post about this project for more information.
plz fix it, thanks.
Hi ,
while i am using this gem i get wondering error.
CalendarDateSelect.format = :american # for i want MM/DD/YYYY format
all setup fine calendar date picker fire .
When i click 09/06/2011 it show in textfield after select but save in data base as 06-09-2011.
When validations fail form back it selects 06/09/2011 instead of 09/06/2011 .
It swap month to date , how it is possible?
Let me know any one for this issue , please.
Thanks,
prasad.
If you enter or select january 29,30 or 31 in the calendar then next month (little greyed out dates from next month at the bottom) are not from february but from march, the calendar is skipping february all together. You can see it by mousing over, or if you select the date it will come up as a date in march, not february.
Hi, i am using rails 3.0.9 in windows, and when i install the gem for my app and try to run the server i get the next error
Errno::ENOENT: No such file or directory - C:/public/blank_iframe.html
as you can see the gem is looking for the file in the system root, instead the app root
i get too the next deprecation warning
DEPRECATION WARNING: RAILS_ROOT is deprecated. Please use ::Rails.root.to_s. (called from (root) at C:/Users/Ignacio/plateria/tienda/config/application.rb:7)
PD: i am using the 1.16.3
Hi, really nice plugin.
I was check a really unusual behavior with the following code:
<%= label_tag I18n.t('activerecord.reports.dates') %> <%= calendar_date_select_tag "begin_date", params[:begin_date], :year_range => 3.years.ago..3.years.from_now, :popup => :force%> <%= label_tag I18n.t('activerecord.reports.date_and') %> <%= calendar_date_select_tag "end_date", params[:end_date], :year_range => 3.years.ago..3.years.from_now, :popup => :force %>
In the first calendar (begin_date) select a month and a day, let's say 2010-06-01, next in the second calendar (end_date) i can select june again, but when select a day it will get the next month. In the date preview the month 6 desapear, it show 2010-05-31 and next day is 2010-07-01 =(
I'm running rails 2.3.8 with firefox 3.6.3 (ubuntu) with CalendarDateSelect version 1.16.1. and with <%= calendar_date_select_includes nil, :locale=>'pt' %> in the form.
Cheers,
Thanks for merging my pull, if you also bump the version I could get rid of a :git dependency in my Gemfile :)
How does it work with rails 3 ?
Any chance we might get this?
Using the popup calendar on a site for mobile. In the iphone the popup calendar does not close when you select a day on the calendar. It remains open and you have keep tapping the day in order for it to close. I also tested out Please Help! Thanks.
With selected date as the 31st of any given month, selecting "next month", then mouseover on days and you will see the incorrect month. Here is an example:
Pre-select October 31, 2010. Then open the js calendar again. Advance to the next month which would be November. November looks ok in the grid. But, mouseover or select any date in the November grid and you are left with the month of December instead. If you choose November 10, you will get December 10 (12/10/2010).
The problem is in calendar_date_select.js line 316. First the hover_date is created with October 31, 2010 as the date with the intention of replacing the day, month, and year. Year is replaced no problem with hover_date.setYear(element.year).
But then hover_date.setMonth does have a problem. See October 31, advanced to the next month would theoretically give you November 31, 2010. Since there is no November 31, 2010, the JavaScript Date call magically advances you to December 31, 2010.
If you call hover_date.setDate(element.day) first, then the day is changed to the 10th so we would have October 10, 2010, then setMonth(element.month) would change the month to November 10, 2010, and we'd be all set.
So switch hover_date.setDate so that it is before hover_date.setMonth, and it works.
Hi,
I'm in the process of upgrading an app from Rails 2.3 to 3.2. In order to get the plugin working correctly I had to do the following:
Add calendar date select to the Gemfile:
gem 'calendar_date_select', '2.0.0',
:git => 'git://github.com/timcharper/calendar_date_select.git'
Add the following to my layout/application (for silver style):
<%= stylesheet_link_tag 'calendar_date_select/silver' %>
<%= javascript_include_tag 'calendar_date_select/calendar_date_select' %>
Add the css and js assets to the asset pipeline in config/application.rb:
config.assets.precompile += ['calendar_date_select/*.css', 'calendar_date_select/*.js']
Create the file config/initializers/calendar_date_select.rb with the following:
require 'calendar_date_select'
ActionView::Helpers::FormHelper.send(:include, CalendarDateSelect::FormHelpers)
ActionView::Base.send(:include, CalendarDateSelect::FormHelpers)
ActionView::Base.send(:include, CalendarDateSelect::IncludesHelper)
Without the config/initializer/calendar_date_select.rb file, the calendar_date_select helper method is no longer available in the views:
undefined method `calendar_date_select'
So my question is... is a config/initializer file required? Is there a better way to get the helpers loaded in the ActionView context?
Thanks,
Jeff
Is it supported in rails 3.1? I tried to do every step in "http://technicaldebt.wetpaint.com/page/Calendar+Date+Select" tutorial but in wiew it is not rendered. Nothing shown... Thanks...
Can anybody help me, please?
In My code : <%= calendar_date_select "project_effective_hour[from_date]",@project_effective_hour.from_date||Date.today,:popup=> 'force',:class => 'input-text'%>
Output : `@project_effective_hour[from_date]' is not allowed as an instance variable name
Kindly help me to resolve this issue.
Currently if you use the :popup => 'force' option the form will not work with javascript disabled because the readonly attribute is in the html. I went ahead and forked the project and added a :support_no_js => true option that uses javascript to set the entry field to readonly rather than in the html so that the entry field is still editable for user's without javascript.
http://github.com/jfredson/calendar_date_select/tree/master
Feel free to adopt/modify/ignore as you see fit.
Thanks for a great gem.
Hi,
The problem/fix indicated here (http://ankitbparekh.blogspot.com/2010/04/unknown-runtime-error-ie-in-prototypejs.html) had been causing me grief for months and finding this and making the one line change suggest just today solved all my issues. I have no idea how or why it works, and it's likely an IE bug (at least in that it can't give a descriptive error message), but IE seems to not like the calendar_date_select code.
I would strongly urge you integrate this into your codebase. It causes no negative effects on other browsers. Unfortunately I can no longer link you to my live, non-working site, as that would require my re-breaking it, but if you need proof that this is an issue, please let me know and I'll figure something out.
Thanks,
Mike
This funny code fails to set date:
for (var x = 0; x<=3; x++) t_selected_date.setDate(parts.get("day"));
t_selected_date.setYear(parts.get("year"));
t_selected_date.setMonth(parts.get("month"));
Use following code to prosper:
t_selected_date.setYear(parts.get("year"));
t_selected_date.setMonth(parts.get("month"));
t_selected_date.setDate(parts.get("day"));
To reproduce:
<% form_for :user do |user_form|
user_form.fields_for :user_dates do |dates_form| %>
<%= dates_form.calendar_date_select :first_date %>
<% end %>
Does your plugin support available dates or times?
Say I have a db table that has dates and times available for that day, can I specify that days that are available have a particular "available" class for css styling? anything without it is greyed out?
I apologize if this exists. If it doesn't, I think it is a great feature request. jqueryui half-way provides this, but is very difficult to implement ajax requests with it (to get the hours for the day selected).
If you try to select a date in August 2011, it's always selected the same day, but in July.
I have a problem passing custom :index to fields_for, like
<%= f.fields_for :item, item, :index => 'someindex' do |fields| %>
for all fields it works fine except calendar_date_select
If I pass :index to calendar_date_select it works fine:
<%= fields.calendar_date_select :date, :index => 'someindex' %>
How to reproduce:
Create Rails form with calendar date select and format = finnish (dd.mm.yyyy).
Add "validates_presence_of :date" to rails model.
Enter invalid date into input field (e.g. "25.6.20101", superfluous "1").
Post form.
--> date field will be nil in database, although validates_presence_of was used.
There isn't a tag for 1.16.2 yet history.txt mentions there is a release for it.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.