Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pman ls and pman i both sort output by last edited time. #42

Merged
merged 3 commits into from
May 22, 2024

Conversation

theredditbandit
Copy link
Owner

This means the project which was edited the last , shows up on top.

@theredditbandit theredditbandit merged commit 8881e08 into master May 22, 2024
4 checks passed
}
return fmt.Sprint(lastModTime.Format("02 Jan 06 15:04"))
return fmt.Sprint(lastModTime.Format("02 Jan 06 15:04")), int64(lastModTime.Unix())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This approach is strange. You should returned a date, and let the caller transform it

lastEdited = utils.GetLastModifiedTime(db.DBName, p)
rec := map[string]string{p: lastEdited}
lastEdited, timestamp = utils.GetLastModifiedTime(db.DBName, p)
rec := map[string]string{p: fmt.Sprintf("%s-%d", lastEdited, timestamp)}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Define a function that format a time.Time into this

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup , that makes much more sense. so much easier to do than what I did too.

I'll fix this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants