https://github.com/yaacov/libhdate-js
A pure javascript (partial) implementation of libhdate
https://github.com/yaacov/libhdate-js
Last synced: 6 months ago
JSON representation
A pure javascript (partial) implementation of libhdate
- Host: GitHub
- URL: https://github.com/yaacov/libhdate-js
- Owner: yaacov
- License: gpl-3.0
- Created: 2015-05-16T01:24:13.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-09-16T14:24:12.000Z (about 10 years ago)
- Last Synced: 2025-04-10T23:05:37.532Z (6 months ago)
- Language: JavaScript
- Homepage:
- Size: 203 KB
- Stars: 5
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# libhdate-js
A pure javascript (partial) implementation of libhdate[](https://www.npmjs.org/package/libhdate)
## Install
npm install libhdate
## Basic Usage
```js
// 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);
```