Giter Club home page Giter Club logo

calendar_date_select's Introduction

CalendarDateSelect

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.

calendar_date_select's People

Contributors

artmotion avatar deric avatar djberube avatar ewildgoose avatar frisoft avatar ginkel avatar graaff avatar grosser avatar htanata avatar jbaehr avatar kikito avatar laurynas avatar lightningdb avatar madmas avatar marcandre avatar maxlap avatar mernen avatar ndbroadbent avatar netmaniac avatar oillio avatar raszi avatar sdumitriu avatar shihgianlee avatar shingara avatar timcharper avatar ujifgc avatar vanderhoorn avatar voxik avatar webveteran avatar whatcould avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

calendar_date_select's Issues

Compressing with Asset Packager (using Google's Closure Compiler) does not work

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?

wrong cell highlighted in calendar

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.

When "December 10, 2010" is put in text field, javascript calendar won't popup: getFullYear is not a function

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.

License missing from gemspec

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.

CalendarDateSelect.format = :american issue ?

Hi ,
while i am using this gem i get wondering error.

In environment file:

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 january 29,30 or 31 selected calendar skips february

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.

Error in roots with windows and rails 3.0.9

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

Unusual behavior with 2 calendar_date_select_tags

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,

version bump ?

Thanks for merging my pull, if you also bump the version I could get rid of a :git dependency in my Gemfile :)

popup calendar issue

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 shows incorrect month

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.

Rails 3.2; Is a config/initializers/calendar_date_select file needed? Am I doing it right?

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 not allowed as an instance variable name

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.

Support for No Javascript with :popup => 'force'

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.

IE Compatability Change

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

Problems with date in Opera 10.5

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"));

Problem with nested form fields

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 %>

Available Dates / hours

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).

fields_for :index problem

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' %>

Invalid year entered -> date field will be set to nil AFTER validations

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.