A Ruby gem for generating Nepali Calendar (Bikram Sambat Calendar). You can also convert dates between BS and AD. Nepali Calendar is based on the API from codeartsnepal.
Add this line to your application's Gemfile:
gem 'nepali_calendar'
And then execute:
$ bundle
Or install it yourself as:
$ gem install nepali_calendar
Initialize Calendar Object in controller with:
@cal = NepaliCalendar::Calendar.new
To convert date from AD to BS, copy the following code in the view file:
<%= @cal.ad_to_bs('2015', '09', '10') %>
To convert date from BS to AD, copy the following code:
<%= @cal.bs_to_ad('2072', '05', '24') %>
- Fork it ( https://github.com/lalusaud/nepali_calendar/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request