Skip to content

Commit

Permalink
Make comma after dayMonthYear facultative
Browse files Browse the repository at this point in the history
  • Loading branch information
ejimsan committed Dec 20, 2024
1 parent 5c46641 commit 4edc2b8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/chronology/domain/DateString.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ export class MesopotamianDateString extends MesopotamianDateBase {
toString(): string {
const dayMonthYear = this.dayMonthYearToString().join('.')
const dateTail = `${this.kingEponymOrEraToString()}${this.ur3CalendarToString()}${this.modernDateToString()}`
return [dayMonthYear, dateTail]
const joiner = dateTail.trim().startsWith(',') ? '' : ' '
return [dayMonthYear, dateTail.trim()]
.filter((string) => !_.isEmpty(string))
.join(' ')
.join(joiner)
}

private modernDateToString(): string {
Expand Down

0 comments on commit 4edc2b8

Please sign in to comment.