Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including libhdate with all npm packages installed. Try it out:

var libhdate = require("libhdate")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

libhdate v0.3.2

A pure Javascript implementation of libhdate

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) {
t += timeZone;
return "" + Math.floor(t / 60) + ":" + (t % 60);
});
console.log(timeStrings);

Metadata

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free