Neoclassical Programming Multitude
Need private packages and team management tools?Check out npm Teams »

libhdate

0.3.2 • Public • Published

libhdate-js

A pure javascript (partial) implementation of libhdate

NPM Version

Install

npm install libhdate

Basic Usage

// import this module
var Hdate = require("libhdate");
 
// create a new Hdate object
var h = new Hdate();
 
// Set the Date
h.setGdate(16, 5, 2015);
 
// Printout
console.log(h);
 
// get holydays
var holyday = h.getHolyday(h);
var omer = h.getOmerDay(h);
console.log(h.getHolydayName(holyday));
console.log(omer);
 
// get parasha for next shabbat
var reading = h.getShabbatsParasha(h);
console.log(h.getParashaName(reading));
 
// get times
var latitude = 32.07;
var longitude = 34.77;
var timeZone = 3 * 60;
var times = h.getSunTimeFull(h, latitude, longitude);
 
// adjust time zone
var timeStrings = times.slice(1).map(function (t) {
+= timeZone;
return "" + Math.floor(/ 60) + ":" + (% 60);
});
console.log(timeStrings);

Install

npm i libhdate

DownloadsWeekly Downloads

0

Version

0.3.2

License

GPLv3

Last publish

Collaborators

  • avatar