
Security News
ESLint Adds Support for Parallel Linting, Closing 10-Year-Old Feature Request
ESLint now supports parallel linting with a new --concurrency flag, delivering major speed gains and closing a 10-year-old feature request.
bootstrap_calendar_rails
Advanced tools
This gem provide simple and easy way to create calendar with Twitter Bootstrap and Rails.
First of all you should include twitter bootstrap in your app. You can do it manually, or use twitter-bootstrap-rails gem.
To use Less stylesheets, you'll need the less-rails gem, and one of Javascript runtimes supported by CommonJS.
Include these lines in the Gemfile to install the gems from RubyGems.org:
gem "therubyracer"
gem "less-rails" #Sprockets (what Rails 3.1 uses for its asset pipeline) supports LESS
gem "bootstrap_calendar_rails"
Then run bundle install
from the command line:
bundle install
Then run the bootstrap generator to add Calendar includes into your assets:
rails generate calendar:install less
If you don't need to customize the stylesheets using Less, the only gem you need is the bootstrap_calendar_rails
gem:
gem "bootstrap_calendar_rails"
After running bundle install
, run the generator:
rails generate calendar:install static
You should use something like this in the view
bootstrap_calendar Date.today {} do |date|
date.day.to_s
end
it show you calendar for the current month.
You can specify another start week day. Use start_day
key for this:
bootstrap_calendar Date.today { start_day: :wednesday } do |date|
date.day.to_s
end
You can extend day classes. Use extra_day_classes
key and lambda for this:
options = { extra_day_classes: lambda { |classes, date|
classes << 'cal-day-daylight' if true
}
}
bootstrap_calendar Date.today, options do |date|
date.day.to_s
end
An example application is available at sharpyfox/bootstrap_calendar_rails_example. You can view it running on heroku here. Contributions welcome.
This gem are highly inspired by:
davidray and davidray / twitter-bootstrap-calendar Basically this gem is an adoptation davidray / twitter-bootstrap-calendar
for my flavour
Serhioromano and Serhioromano / bootstrap-calendar I stole all css markup from him
Thanks guys!
If you'd like to add features (or bug fixes) to improve the gem, you can fork the GitHub repo and make pull requests. Your code contributions are welcome!
FAQs
Unknown package
We found that bootstrap_calendar_rails demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ESLint now supports parallel linting with a new --concurrency flag, delivering major speed gains and closing a 10-year-old feature request.
Research
/Security News
A malicious Go module posing as an SSH brute forcer exfiltrates stolen credentials to a Telegram bot controlled by a Russian-speaking threat actor.
Security News
Rspack launches Rslint, a fast TypeScript-first linter built on typescript-go, joining in on the trend of toolchains creating their own linters.