ਨਾਨਕਸ਼ਾਹੀ ਇੱਕ ਰੂਬੀ ਪਰੋਗਰਾਮਿੰਗ ਭਾਸ਼ਾ ਚ ਲਿਖਿਆ ਗਿਆ gem ਹੈ ਜੋ ਕਿ ਪਾਲ ਸਿੰਘ ਪੁਰੇਵਾਲ ਦੁਆਰਾ ਲਿਖੇ ਗਏ ਮੂਲ ਨਾਨਕਸ਼ਾਹੀ ਕਲੰਡਰ ਤੇ ਅਧਾਰਿਤ ਹੈ।
ਇਹ ਆਮ/ਗਰਿਗੋਰੀਅਨ ਕਲੰਡਰ ਦੀਆਂ ਤਰੀਕਾਂ ਤੋਂ ਨਾਨਕਸ਼ਾਹੀ ਤੇ ਵਾਪਸ ਬਦਲਣ ਦੇ ਤਰੀਕੇ ਮੁਹੱੲੀਆ ਕਰਵਾਉਂਦਾ ਹੈ। ਤੁਸੀਂ ਇਸ ਨੂੰ ਕਿਸੇ ਵੀ ਰੂਬੀ ਪਰੋਗਰਾਮ ਵਿੱਚ ਨਾਨਕਸ਼ਾਹੀ ਤਰੀਕਾਂ ਵਰਤਣ ਲੲੀ ਵਰਤ ਸਕਦੇ ਹੋ।
Nanakshahi is a ruby gem for Nanakshahi Calendar based on the original work by Pal Singh Purewal.
It provides helper methods to convert a Gregorian or Common Era(CE) date into Nanakshahi date and vice versa. You can use it to enable Nankshahi dates in any of your applications.
Add this line to your application's Gemfile:
gem 'nanakshahi'
And then execute:
$ bundle
Or install it yourself as:
$ gem install nanakshahi
To start using Nanakshahi gem
require 'nanakshahi'
date = Nanakshahi.new # Creates an object with 1 Chet, Nanakshahi
date = Nanakshahi.new(550)
date = Nanakshahi.new(550, 10)
date = Nanakshahi.new(550, 10, 5)
date = Nanakshahi.from_gregorian(2019,1,8)
date = Nanakshahi.today
Nanakshahi.new(550,1,1).gurpurab?
Nanakshahi.new(550,1,1).gurpurabs
Nankshahi gem monkey-patches Date
class to provide it to_nanakshahi
method
date = Date.new(2019-2-18)
p date.to_nanakshahi
to_s
method prints Nanakshahi date either Nanakshahi or Dhundkaal suffix (pre-Guru Nanak). To take care of 0 year correction, like gregorian, it is assumed that 1 Dhundkaal precedes 1 Nanakshahi when printed with suffix.
date = Nanakshahi.new(1400-2-18)
puts date
to_gurmukhi
prints the date in Gurmukhi characters, complete with Gurmukhi numerals.
date = Nanakshahi.new(1400-2-18)
puts date.to_gurmukhi
For a complete list of all the methods, check out the documentation.
Bug reports and pull requests are welcome on GitHub at https://github.com/punjab/nanakshahi.
The gem is available as open source under the terms of the MIT License.