Created
July 28, 2014 06:10
-
-
Save ProTip/ec50b2a88fa8f8bea2e3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func ParseBillingPeriodDate(s string, report *BillingReport) interface{} { | |
var returnTime time.Time | |
var err error | |
switch s { case "": | |
returnTime = report.InvoicePeriod | |
default: | |
returnTime, err = time.Parse("2006/01/02 15:04:05", s) | |
if err != nil { panic(err.Error()) } | |
} | |
return returnTime.Format(time.RFC3339) | |
} | |
// | |
func ParseBillingPeriodDate(s string, report *BillingReport) interface{} { | |
var returnTime time.Time | |
var err error | |
switch s { | |
case "": | |
returnTime = report.InvoicePeriod | |
default: | |
returnTime, err = time.Parse("2006/01/02 15:04:05", s) | |
if err != nil { | |
panic(err.Error()) | |
} | |
} | |
return returnTime.Format(time.RFC3339) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment