Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bikram-sambat

Package Overview
Dependencies
Maintainers
10
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bikram-sambat - npm Package Compare versions

Comparing version 1.6.0 to 1.7.0

2

package.json
{
"name": "bikram-sambat",
"version": "1.6.0",
"version": "1.7.0",
"description": "JS utilities for converting between the Nepali Bikram Sambat (Vikram Samvat) and Gregorian (standard European) calendars.",

@@ -5,0 +5,0 @@ "main": "src/index.js",

@@ -51,2 +51,10 @@ var toDevanagari = require('eurodigit/src/to_non_euro').devanagari;

function toDev(year, month, day) {
return {
day: toDevanagari(day),
month: MONTH_NAMES[month-1],
year: toDevanagari(year)
};
}
function toBik_euro(greg) {

@@ -62,4 +70,5 @@ var d = toBik(greg);

function toBik_text(greg) {
var d = toBik(greg);
return toDevanagari(d.day) + ' ' + MONTH_NAMES[d.month-1] + ' ' + toDevanagari(d.year);
var bik = toBik(greg);
var dev = toDev(bik.year, bik.month, bik.day);
return dev.day + ' ' + dev.month + ' ' + dev.year;
}

@@ -101,2 +110,3 @@

toBik: toBik,
toDev: toDev,
toBik_dev: toBik_dev,

@@ -103,0 +113,0 @@ toBik_euro: toBik_euro,

@@ -41,2 +41,23 @@ var _ = require('lodash'),

describe('#toBik()', function() {
_.forIn({
// gregorian -> bikram
'1950-04-13': { day: 1, month: 1, year: 2007 },
}, function(expectedBikram, gregorian) {
it('should convert ' + gregorian + ' AD => ' + expectedBikram + ' BS', function() {
// expect
assert.deepEqual(bs.toBik(gregorian), expectedBikram);
});
});
});
describe('#toDev()', function() {
it('should convert 2050-2-1 to ', () => {
assert.deepEqual(bs.toDev(2050, 2, 1), { day: '१', month: 'जेठ', year: '२०५०' });
});
});
describe('#toBik_euro()', function() {

@@ -43,0 +64,0 @@ _.forIn(test_data_for('toBik_euro'), function(expectedBikram, gregorian) {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc