JSPM

  • Created
  • Published
  • Downloads 216
  • Score
    100M100P100Q97347F
  • License MIT

Convert Gregorian date to Kollavarsham date and vice versa

Package Exports

  • kollavarsham

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (kollavarsham) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

kollavarsham

Build Status Dependency Status Dev-Dependency Status Coverage Status

Convert Gregorian date to Kollavarsham date and vice versa

Install

TypeScript/JavaScript/Node.js NPM version

$ npm install kollavarsham

Python PyPI version

$ pip install kollavarsham

C#/dotnet NuGet version

$ dotnet add package KollavarshamOrg.Converter

Usage

TypeScript/JavaScript/Node.js

import { Kollavarsham } from 'kollavarsham';

const options = {
  system: 'SuryaSiddhanta',
  latitude: 10,
  longitude: 76.2
};

const kollavarsham = new Kollavarsham(options);

const today = kollavarsham.fromGregorianDate(new Date());

console.log(today.year, today.mlMasaName, today.date, `(${today.mlNaksatraName})`);

Python

import datetime
import pytz
import kollavarsham

now = pytz.utc.localize(datetime.datetime.utcnow())
kv = kollavarsham.Kollavarsham(latitude=10, longitude=76.2, system="SuryaSiddhanta")

today = kv.from_gregorian_date(date=now)
print(today.year, today.ml_masa_name, today.date, '(' + today.naksatra.ml_malayalam + ')')

C#/dotnet

using System;
using KollavarshamOrg;

namespace Test
{
    class Program
    {
        static void Main(string[] args)
        {
            var settings = new Settings {
                Latitude = 10,
                Longitude = 76.2,
                System = "SuryaSiddhanta"
            };
            var kv = new Kollavarsham(settings);
            var today = kv.FromGregorianDate(DateTime.Now);
            Console.WriteLine($"{today.Year.ToString()} {today.MlMasaName} {today.Date.ToString()} ({today.MlNaksatraName})");
        }
    }
}

Documentation

TypeScript/JavaScript/Node.js

Check out the Kollavarsham class within the API documentation as this is the entry point into the library.

Release History

Check out the history at GitHub Releases

License

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