bikram-sambat
Advanced tools
Comparing version 1.5.0 to 1.5.1
{ | ||
"name": "bikram-sambat", | ||
"version": "1.5.0", | ||
"version": "1.5.1", | ||
"description": "JS utilities for converting between the Nepali Bikram Sambat (Vikram Samvat) and Gregorian (standard European) calendars.", | ||
@@ -23,3 +23,3 @@ "main": "src/index.js", | ||
"author": "alxndrsn", | ||
"license": "ISC", | ||
"license": "Apache-2.0", | ||
"bugs": { | ||
@@ -33,4 +33,4 @@ "url": "https://github.com/alxndrsn/bikram-sambat.js/issues" | ||
"jshint": "^2.9.5", | ||
"lodash": "^4.17.4", | ||
"mocha": "^3.2.0" | ||
"lodash": "^4.17.11", | ||
"mocha": "^5.2.0" | ||
}, | ||
@@ -37,0 +37,0 @@ "dependencies": { |
@@ -25,4 +25,3 @@ var toDevanagari = require('eurodigit/src/to_non_euro').devanagari; | ||
function daysInMonth(year, month) { | ||
// TODO why does this accept 0? | ||
if(month < 0 || month > 12) throw new Error('Invalid month value ' + month); | ||
if(month < 1 || month > 12) throw new Error('Invalid month value ' + month); | ||
var delta = ENCODED_MONTH_LENGTHS[year - 2000]; | ||
@@ -74,9 +73,6 @@ if(typeof delta === 'undefined') throw new Error('No data for year: ' + year + ' BS'); | ||
var timestamp = BS_EPOCH_TS; | ||
while(year >= BS_YEAR_ZERO) { | ||
while(month >= 1) { | ||
while(--day >= 0) { | ||
timestamp += MS_PER_DAY; | ||
} | ||
day = daysInMonth(year, --month); | ||
} | ||
do while(day--) timestamp += MS_PER_DAY; | ||
while(--month && (day = daysInMonth(year, month))); | ||
day = daysInMonth(--year, month = 12); | ||
@@ -83,0 +79,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8945
6
195