job has multiline formatter

This commit is contained in:
Bel LaPointe
2022-01-10 23:00:45 -05:00
parent 2791ba6763
commit ec2b514a9f
3 changed files with 18 additions and 9 deletions

View File

@@ -34,3 +34,16 @@ func (j Job) String() string {
func (j JobLocation) String() string {
return fmt.Sprintf("%s, %s @ %s", j.City, j.State, j.Date.Format("Monday Jan 02"))
}
func (j Job) FormatMultilineText() string {
return fmt.Sprintf(
"--- %s => %s ---\nPickup: %s\nDropoff: %s\nNotes: %d lbs, %d miles, %s",
j.Pickup.State,
j.Dropoff.State,
j.Pickup.String(),
j.Dropoff.String(),
j.Weight,
j.Miles,
j.Meta,
)
}