1.7.0 • Published 4 years ago
bikram-sambat v1.7.0
bikram-sambat
Javascript and Java utilities for converting between the Nepali Bikram Sambat (Vikram Samvat) and Gregorian (standard European) calendars.
Javascript
Installation
npm install bikram-sambatUsage
var bs = require('bikram-sambat');
var days_in_baisakh_2000 = bs.daysInMonth(2000, 1);
console.log(bs.toBik_euro('2017-03-28'));
> 2073-12-15
console.log(bs.toBik_dev('2017-03-28'));
> २०७३-१२-१५
console.log(bs.toBik_text('2017-03-28'));
> १५ चैत २०७३Java
Java utilities for converting between the Nepali Bikram Sambat (Vikram Samvat) and Gregorian (standard European) calendars.
Installation
// TODO include gradle config hereUsage
BsCalendar bs = BsCalendar.getInstance();
int daysInBaisakh2000 = bs.daysInMonth(2000, 1);
System.out.println(bs.toBik_euro('2017-03-28'));
> 2073-12-15
System.out.println(bs.toBik_dev('2017-03-28'));
> २०७३-१२-१५
System.out.println(bs.toBik_text('2017-03-28'));
> १५ चैत २०७३Android
Re-usable Android widgets for date inputs using Bikram Sambat calendar.
See usage examples in java/android-demo-app.
Bootstrap
twitter-bootstrap widget available from npm:
require('bikram-sambat-bootstrap');For usage example, see bootstrap/dist.
Development
Run tests
- Install android sdk
- Execute
make test
Update compressed days in month data
- Update
/test-data/daysInMonth.jsonas required - The first entry in
/test-data/daysInMonth.jsonas the BS Epoch. Take this and convert it to AD and update the bsEpoch constant below. - Run the script: node ./scripts/encode-days-in-month.js
- Copy the output code into the files overwriting the existing hardcoded values
Publish
Java
- Make a tag called
java-${version}, eg:java-1.0.0 - Push your tag
- Wait for travis to publish to our maven repo
JavaScript
- Make a tag called
js-${version}, eg:js-1.5.1 - Run
make release-js - Push your tag
Bootstrap
- If you've made changes to the JavaScript library, publish it first and update the
/bootstrap/package.jsonfile to depend on the updated libary - Make a tag called
bootstrap-${version}, eg:bootstrap-1.4.3 - Run
make release-bootstrap - Push your tag