Skip to content

Commit

Permalink
Merge branch 'main' of github.com:sumanchapai/ere
Browse files Browse the repository at this point in the history
  • Loading branch information
sumanchapai committed May 7, 2024
2 parents 6e19f37 + a625b03 commit c13e5a1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions cmd/date_format.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import (
type Calendar string

const (
AD Calendar = "AD"
BS Calendar = "BS"
dateSeparator = "-"
AD Calendar = "AD"
BS Calendar = "BS"
// dateSeparator = "-"
)

var (
Expand Down Expand Up @@ -56,7 +56,7 @@ func (d Date) String() string {
} else {
dayString = fmt.Sprintf("%02d", d.day)
}
return fmt.Sprintf("%v%v%v%v%v%v%v", yearString, dateSeparator, monthString, dateSeparator, dayString, dateSeparator, d.calendar)
return fmt.Sprintf("%v-%v-%v-%v", yearString, monthString, dayString, d.calendar)
}

func getTodaysDateInAD() Date {
Expand Down Expand Up @@ -139,7 +139,7 @@ func parseAbsoluteDateString(date string) (Date, error) {
// *-10-29-AD : every year, oct 29
// *-1-10-BS : every year, baiskah 10
// *-*-1-BS : the first of every nepali month
parts := strings.Split(date, dateSeparator)
parts := strings.Split(date, "-")
if len(parts) != 4 {
return toReturn, errInvalidDate
}
Expand Down

0 comments on commit c13e5a1

Please sign in to comment.