-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathsample.js
More file actions
34 lines (30 loc) · 1.28 KB
/
sample.js
File metadata and controls
34 lines (30 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
//Please use "import BaziConverter from 'bazi-converter'" instead for production
import BaziConverter from "./BaziConverter.js";
// For normal calculation
let bazi = new BaziConverter(1994, 5, 10, 21);
console.log("===NORMAL CASE===");
console.log(bazi.getBaziJson());
console.log(bazi.getBaziJsonWithElementalZodiac());
console.log(bazi.translateBaziEnglish());
console.log(bazi.getBaziChineseFullString());
// For calculation where hour is not recognized
bazi = new BaziConverter(1993, 5, 10, -1);
console.log("===NO HOUR CASE===");
console.log(bazi.getBaziJson());
console.log(bazi.getBaziJsonWithElementalZodiac());
console.log(bazi.translateBaziEnglish());
console.log(bazi.getBaziChineseFullString());
// For calculation where hour is not recognized
bazi = new BaziConverter(2025, 5, 10, 21);
console.log("===2025 test case===");
console.log(bazi.getBaziJson());
console.log(bazi.getBaziJsonWithElementalZodiac());
console.log(bazi.translateBaziEnglish());
console.log(bazi.getBaziChineseFullString());
// For calculation where hour is not recognized
bazi = new BaziConverter(2030, 5, 10, 21);
console.log("===2030 test case===");
console.log(bazi.getBaziJson());
console.log(bazi.getBaziJsonWithElementalZodiac());
console.log(bazi.translateBaziEnglish());
console.log(bazi.getBaziChineseFullString());