Giter Club home page Giter Club logo

kollavarsham-nodejs's Introduction

npm Travis Code Climate Code Climate David David

Convert Gregorian date to Kollavarsham date and vice versa

UPDATE (9/16/2015): This ES5 version of the library has been ported into an ES2015/ES6 version that is transcompiled by Babel at https://github.com/kollavarsham/kollavarsham-js. The core npm package will be published from that repo from here onwards.

Getting Started

Install the module with: npm install kollavarsham

Usage

var Kollavarsham = require('kollavarsham');

var options = {
  system: 'SuryaSiddhanta',
  latitude: 10,
  longitude: 76.2,
  outputFormat: 'verbose'
};

var kollavarsham = new Kollavarsham(options);

var todayInMalayalamEra = kollavarsham.fromGregorianDate(new Date());

var today = kollavarsham.toGregorianDate(todayInMalayalamEra);

Documentation

Click here to visit the API Documentation

CLI app

Check out the cli module (GitHub repo) for the kollavarsham cross-platform CLI app

npm install -g kollavarsham-cli

kollavarsham --help

Contributing

Check the Contributing guide.

Release History

Check out the history at GitHub Releases

License

Copyright (c) 2014-2015 The Kollavarsham Team. Licensed under the MIT license.

kollavarsham-nodejs's People

Contributors

floydpink avatar arunkutty avatar

Stargazers

Krishna Guragai avatar  avatar

Watchers

 avatar James Cloos avatar  avatar  avatar

Forkers

jbnicolai

kollavarsham-nodejs's Issues

Error in calculating Malayalam Year from Saka Year

This gist is the Malyalam calendar for 2015, which is the response from http://calendar.kollavarsham.org/api/years/2015 (with Accept: plain/text header)

And as can be seen there, for the few days in March and April (starting from this line) the Malayalam year jumps one incorrectly.

This seems to be because 2015-March-21 is the beginning of a new year in the Saka Calendar and the saura masa (or malayalam month) has still not crossed into the next month to make the current version of the equation to calculate the Malyalam Year work:

Offending lines at lines 110 and 111 in lib/calculations.js:

    var malayalamYear = globals.YearSaka - 747 +
      math.truncate((sauraMasaNum - globals.malayalaMasaNum + 12) / 12);

Difference in the definition of "First Day of the Month"?

The difference in the definition of the first day of the month (mentioned in passing on p.14 - p.15 in this paper - see screenshot below for the excerpt) is causing the discrepancy (as compared to the Saka solar month and day) in the Kollavarsham dates of some months.

kollavarsham-malayala-masam-date-discrepancy

Consider this example:
kollavarsham -b 16:02:2014 yields this:

Output
------
Saka : 1935 02 Magha      (10)  [Krsnapaksa]
Saura: 1935 04 Kumbha     (10)  P-phalguni
ME   : 1189 04 Kumbham    (06)  Pooram

And this seems to match with the Deepika calendar for 2014

But this command's output does not match the day alone with the calendar:
kollavarsham -b 16:03:2014

Output
------
Saka : 1935 15 Phalguna   (11)  [Suklapaksa]
Saura: 1935 03 Mina       (11)  P-phalguni
ME   : 1189 03 Meenam     (07)  Pooram

@arunkutty Thoughts?

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.