Skip to content

A Ruby gem for generating Nepali Calendar & converting dates between AD to BS.

License

Notifications You must be signed in to change notification settings

sarojkh/nepali_calendar

 
 

Repository files navigation

Nepali Calendar

Build Status Gem Version Code Climate Test Coverage

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.

Installation

Add this line to your application's Gemfile:

gem 'nepali_calendar'

And then execute:

$ bundle

Or install it yourself as:

$ gem install nepali_calendar

Usage

Rails 3/4

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

Contributing

  1. Fork it ( https://github.com/lalusaud/nepali_calendar/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

About

A Ruby gem for generating Nepali Calendar & converting dates between AD to BS.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 92.4%
  • HTML 7.6%