Skip to content

Commit

Permalink
Feat add ganzhi to luck pillars (#41)
Browse files Browse the repository at this point in the history
* add ganzhi for luck pillars

* hot fix zero luck pillar
  • Loading branch information
tommitoan authored Jul 31, 2024
1 parent 1997766 commit 09a293d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions internal/luckpillars/get_luck_pillars.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,18 @@ func GetLuckPillars(fourPillars *model.FourPillars, gender, passed, remaining in
YearStart: dateTime.Year(),
}

var zeroGanzhi, zeroMainElement string
var zeroValueElement int
var zeroTempStemBranch strings.Builder
zeroTempStemBranch.WriteString(zeroLuckPillars.HeavenlyStem.Name)
zeroTempStemBranch.WriteString(" ")
zeroTempStemBranch.WriteString(zeroLuckPillars.EarthlyBranch.Name)

zeroGanzhi, zeroMainElement, zeroValueElement = ultis.GetGanzhi(zeroTempStemBranch.String())
zeroLuckPillars.GanZhi.Name = zeroGanzhi
zeroLuckPillars.GanZhi.ElementName = zeroMainElement
zeroLuckPillars.GanZhi.ElementValue = zeroValueElement

luckPillars.LuckPillars = append(luckPillars.LuckPillars, zeroLuckPillars)

// Get Dayun rule (Increment or Decrement) with Yin/Yang Male/Female by Year Stem
Expand Down

0 comments on commit 09a293d

Please sign in to comment.