Ticket #43715

convert AJD to LSCD probrem

Date d'ouverture: 2022-01-28 11:40 Dernière mise à jour: 2022-04-01 21:32

Rapporteur:
(Anonyme)
Propriétaire:
(Aucun)
Type:
État:
Ouvert
Composant:
(Aucun)
Jalon:
(Aucun)
Priorité:
5 - moyen
Sévérité:
5 - moyen
Résolution:
Aucun
Fichier:
1

Détails

コメントアウトしている行がない場合はテストに成功て正常に動作している様に見えます。 メントインすると西暦 2022/11/24 が旧暦 2022/10/31 となりテストが失敗します。

{{{

import ajd4jp.iso.Year import org.scalatest.funspec.AnyFunSpec import ajd4jp._ import java.time.LocalDate

class AJDSpec extends AnyFunSpec:

it("ajd to lscd") {
assert(ajdToLscd(2022, 1, 1).toString == "2021/11/29 00:00:00")

// assert(ajdToLscd(2022, 2, 1).toString == "2022/01/01 00:00:00")

assert(ajdToLscd(2022, 11, 23).toString == "2022/10/30 00:00:00") assert(ajdToLscd(2022, 11, 24).toString == "2022/11/01 00:00:00")
}
private def ajdToLscd(year: Int, month: Int, day: Int): LSCD =
val ajd = new AJD(year, month, day) val y = LunisolarYear.getLunisolarYear(ajd) println(s"y.getMonthCount: ${y.getMonthCount}") y.getLSCD(ajd)

}}}

Ticket History (3/4 Histories)

2022-01-28 11:40 Updated by: None
  • New Ticket "convert AJD to LSCD probrem" created
2022-01-28 12:55 Updated by: None
Commentaire

チケットを作成した者です。コードがフォーマットされていなく申し訳ありません。問題としては、一行目があるかないかで結果に影響が出てしまっていいます。

//ajdToLscd(2022, 2, 1).toString == "2022/01/01 00:00:00"
ajdToLscd(2022, 11, 24).toString == "2022/11/01 00:00:00"
2022-04-01 21:32 Updated by: zhgchn
Commentaire

旧暦カレンダーを作成してみたら、広範囲で作成すると、旧暦の11月から旧暦の年末まで不正になる年が出てくる 但し、小範囲で作成すると、上記不正なところが消えるようになるケースがある

Attachment File List

Modifier

You are not logged in. I you are not logged in, your comment will be treated as an anonymous post. » Connexion