PatrickF1 / fzf.fish

🔍🐟 Fzf plugin for Fish
MIT License
1.96k stars 78 forks source link

[Search history] Make date time format configurable #299

Closed tamirzb closed 1 year ago

tamirzb commented 1 year ago

Enable configuring the format of command execution times in Search History through the new fzf_history_time_format variable. This is highly valuable for non-US users who may be accustomed to reading dates as day-month (rather than month-day as the default is), or for people who want to search through previous years of command history.

tamirzb commented 1 year ago

Update: I realized that I didn't include the regex for the preview window, so fixed that.

PatrickF1 commented 1 year ago

Nice, looks good! I'll polish the readme tomorrow. Btw, what's your use case for configuring the date time format?

tamirzb commented 1 year ago

I guess two things: First, my history spans over multiple years, so when I'm searching for things I can reach commands from different years, so having the year in there makes it much more insightful. Second, I am not American, so having the month before the day confuses me :sweat_smile:

PatrickF1 commented 1 year ago

I guess two things: First, my history spans over multiple years, so when I'm searching for things I can reach commands from different years, so having the year in there makes it much more insightful.

Great use case!

Second, I am not American, so having the month before the day confuses me 😅

Oh my gosh me and my American ignorance! Please excuse me. Could you explain what language you speak primarily and what dates in that language looks like?

tamirzb commented 1 year ago

Oh my gosh me and my American ignorance! Please excuse me. Could you explain what language you speak primarily and what dates in that language looks like?

Hahaha no worries. And to be honest I don't think it's a uniqueness of where I'm from, rather of the US. As you can see on Wikipedia, most of the world uses day-month-year as their primary date format, and month-day-year is pretty rare.

Anyway, as long as it's customizable it's really no big deal :)

roland-5 commented 1 year ago

You both sucks. The best format is year-month-day. :P I must say, it's nice feature. I don't have that much history, but there was few times when I struggle searched something similar within years.

PatrickF1 commented 1 year ago

Oh my gosh me and my American ignorance! Please excuse me. Could you explain what language you speak primarily and what dates in that language looks like?

Hahaha no worries. And to be honest I don't think it's a uniqueness of where I'm from, rather of the US. As you can see on Wikipedia, most of the world uses day-month-year as their primary date format, and month-day-year is pretty rare.

Anyway, as long as it's customizable it's really no big deal :)

Haha I totally forgot about that. What's worse is we're still not on the metric system 😭. Thanks for your input! I'll merge this soon.