fme-calendar
v2.1.4
Published
This is the calendar service for xronos
Downloads
13
Readme
Synopsis
This is the calendar part of the Xronos package - a time aware financial database
Code Example
import { Log } from "fme-logger";
var L = new Log("Test Calendar");
import * as mongo from "mongodb";
import { CalendarDay } from "xronos-calendar";
var mongoURL = 'mongodb://localhost:27017/xronos'
mongo.MongoClient.connect(mongoURL, async (err, db) => {
L.info("database connected:",mongoURL);
var dayGenerator = new CalendarDay(db);
var rtn = await dayGenerator.create.init();
var day = await dayGenerator.create.generate(new Date());
})
Motivation
The package generates a holdiay database from 1980 to 2040, from there passed a date it creates a day object that includes elections and holidays and options expiration information.
Installation
npm install --save xronos-calendar
API Reference
export class Day {
_id?: string;
timestamp: Date;
YYYYMMDD: string;
month: number;
year: number;
dow: number;
doy: number;
doyISO:number;
doq: number;
woy: number;
woyISO:number;
quarter: number;
opex:Opex;
lunar:Lunar;
politics: Politics;
holidays : HolidayDay[];
constructor() {
}
}
Tests
Describe and show how to run the tests with code examples.
Contributors
FortunesRocks.me LLC contact me there if you have questions;
License
MIT