Skip to content

rename date type to datetime#10298

Closed
amtoine wants to merge 2 commits intonushell:mainfrom
amtoine:datetime
Closed

rename date type to datetime#10298
amtoine wants to merge 2 commits intonushell:mainfrom
amtoine:datetime

Conversation

@amtoine
Copy link
Copy Markdown
Member

@amtoine amtoine commented Sep 10, 2023

Description

i think we wanted the "date + time" type to be called "datetime" but i stumbled upon

> date now | describe
date

but date now is clearly a datetime

Sun Sep 10 13:10:29 2023

User-Facing Changes

> date now | describe
datetime

Tests + Formatting

After Submitting

@amtoine amtoine marked this pull request as draft September 10, 2023 11:16
@amtoine amtoine marked this pull request as ready for review September 10, 2023 11:31
@fdncred
Copy link
Copy Markdown
Contributor

fdncred commented Sep 10, 2023

I went on a rant about this inconsistency a while back. Not sure where that is but there's probably more than just what this PR does. Like, should format date be format datetime and what about Value::Date and Type::Date, should they be Value::DateTime and Type::DateTime? We already have Expr::DateTime. I'm sure there's more of this type of thing in the codebase.

@amtoine
Copy link
Copy Markdown
Member Author

amtoine commented Sep 10, 2023

I went on a rant about this inconsistency a while back. Not sure where that is but there's probably more than just what this PR does. Like, should format date be format datetime and what about Value::Date and Type::Date, should they be Value::DateTime and Type::DateTime? We already have Expr::DateTime. I'm sure there's more of this type of thing in the codebase.

i agree with this rant of yours, imo, as we only manipulate datetimes we should have datetimes not dates hanging out in Nushell 👍

maybe the only one that might lead to some friction is the date command because Bash has date and not datetime?
but maybe we could go with datetime now? 🤔

@amtoine
Copy link
Copy Markdown
Member Author

amtoine commented Sep 10, 2023

maybe we can go ahead with this PR which is a baby step in the direction of removing the inconsistency? 😋

@sholderbach
Copy link
Copy Markdown
Member

maybe we can go ahead with this PR which is a baby step in the direction of removing the inconsistency? 😋

Nope, if the goal is consistency (at least in the user facing side) then a half baked PR is not the right thing to do.

You also missed nu-color-config/src/style_computer.rs that provides date as a type to style.

Everything that deals with the type/data representation and command names currently uses date. The odd one out is the parsing side with SyntaxShape with datetime. (Tangential rant that user definableSyntaxShapes should probably correspond to types at some point: looking at you path)

@WindSoilder
Copy link
Copy Markdown
Contributor

WindSoilder commented Jan 16, 2025

Thanks for proposing the PR. I think it's too old. And renaming this requires a larger change
I'm going to close it. If you think the change is still necessary, feel free to open a new PR.

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.

4 participants