mesaugat / bikram-sambat-anno-domini-fixtures Goto Github PK
View Code? Open in Web Editor NEWFixtures for B.S. to A.D. date conversion.
Fixtures for B.S. to A.D. date conversion.
If I understand correctly, both EN and NP dates for each array index i
should be strictly less than array index i+1
i.e. it should monotonically increase into the future.
I might have a case where this does not hold true. Check indices 9132
and 9132 + 264 = 9394
.
It's cumbersome to deal with the large JSON in the browser so I curl'd the minified export from commit 67989f2
.
curl https://raw.githubusercontent.com/mesaugat/bikram-sambat-anno-domini-fixtures/67989f277816566067a53ac446e558ed94cc489c/export-minified.json > ref_67989f277816566067a53ac446e558ed94cc489c.json
I wrote this small JS script:
const fs = require('fs')
const file = fs.readFileSync("ref_67989f277816566067a53ac446e558ed94cc489c.min.json")
const refs = JSON.parse(file)
const base = 9132
console.log('Index: ', base, '->', refs[base])
const index = 262
console.log('Index: ', base + index, '->', refs[base + index])
The base
and index
values are computed from the diff-ing I'm doing over at the nepcal
repository.
Summarized results from that script are as follows (in yy-mm-dd
syntax):
index | en date | np date |
---|---|---|
9132 | 1943 -4-4 | 2000-1-1 |
9394 | 1943 -1-1 | 2000-9-17 |
Here, the NP date moves forward in time, but the EN date moves backward.
Raw stdout output:
Index: 9132 -> {
npYear: 2000,
npMonth: 1,
npDay: 1,
enYear: 1943,
enMonth: 4,
enDay: 14
}
Index: 9394 -> {
npYear: 2000,
npMonth: 9,
npDay: 17,
enYear: 1943,
enMonth: 1,
enDay: 1
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.