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

Add cleantime to vs list #1744

Closed
allmightyspiff opened this issue Aug 30, 2022 · 0 comments · Fixed by #1950
Closed

Add cleantime to vs list #1744

allmightyspiff opened this issue Aug 30, 2022 · 0 comments · Fixed by #1950
Assignees

Comments

@allmightyspiff
Copy link
Member

allmightyspiff commented Aug 30, 2022

slcli vs list should display a nice time format. Basically just run the value through utils.cleantime and that should do the trick.

The createDate column should be passed through utils.clean_time() to generate a nice and readable formatted time string.

slcli vs list is a little complicated, my suggestion would be to add a lambda function to the COLUMNS definition that looks like this.

    column_helper.Column(
        'createDate',
        lambda guest: utils.clean_time(guest.get('createDate'))),

The column_helper class basically lets you define a column name and map it to a API result, or in this case, define a function to transform the data whenever its added to the table.

@caberos caberos assigned caberos and unassigned caberos Sep 1, 2022
ramkishor-ch pushed a commit to ramkishor-ch/softlayer-python that referenced this issue May 15, 2023
Added code of lambda function of clean_time
@allmightyspiff allmightyspiff linked a pull request May 22, 2023 that will close this issue
allmightyspiff added a commit that referenced this issue May 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants