Conversation
|
By now, integrating these changes is probably harder, as we have added relative time and other such features. I'm not (currently) up for this, I think my time is better spend elsewhere, but if anyone wants to tackle this it would be hugely appreciated. |
f42d2c9 to
6ec6da4
Compare
|
Yeah, I think #60 should be closed in favor of this PR, which fixes the issues we had with the previous code properly. I’ve updated the code and fixed the Clippy lints. It not only fixes bug, but also reduce a bit the code: if we ignore the Before I updated this code for eza (which was pretty trivial), this PR passed the xtests. I’ll try to re-run xtests on it to check that nothing was broken. |
Done. Ping me when this is ready for review. |
- Improve compatibility with other OSes, timezone are handled for us - Reduce significantly the code to render date and time
|
It looks good to me, however note that |
|
I don't seem to have access to push to this repo/branch but this patch should fix the Windows build and its timezone issues (tested by @agrmohit and myself): diff --git a/src/fs/file.rs b/src/fs/file.rs
index e282f65..9ebddee 100644
--- a/src/fs/file.rs
+++ b/src/fs/file.rs
@@ -528,7 +528,7 @@ impl<'dir> File<'dir> {
}
#[cfg(windows)]
- pub fn changed_time(&self) -> Option<SystemTime> {
+ pub fn changed_time(&self) -> Option<NaiveDateTime> {
self.modified_time()
}
diff --git a/src/output/table.rs b/src/output/table.rs
index d7d39ea..95f73b7 100644
--- a/src/output/table.rs
+++ b/src/output/table.rs
@@ -357,36 +357,10 @@ impl Environment {
#[cfg(unix)]
let users = Mutex::new(UsersCache::new());
- Self { time_offset, numeric, users }
+ Self { time_offset, numeric, #[cfg(unix)] users }
}
}
-#[allow(clippy::unnecessary_wraps)] // Needs to match Unix function
-#[cfg(windows)]
-fn determine_time_zone() -> TZResult<TimeZone> {
- use datetime::zone::{FixedTimespan, FixedTimespanSet, StaticTimeZone, TimeZoneSource};
- use std::borrow::Cow;
-
- Ok(TimeZone(TimeZoneSource::Static(&StaticTimeZone {
- name: "Unsupported",
- fixed_timespans: FixedTimespanSet {
- first: FixedTimespan {
- offset: 0,
- is_dst: false,
- name: Cow::Borrowed("ZONE_A"),
- },
- rest: &[(
- 1_206_838_800, // Sun Mar 30 2008 01:00:00 GMT+0000
- FixedTimespan {
- offset: 3600,
- is_dst: false,
- name: Cow::Borrowed("ZONE_B"),
- },
- )],
- },
- })))
-}
-
lazy_static! {
static ref ENVIRONMENT: Environment = Environment::load_all();
}
|
Maybe you can create a new PR for this? It makes it hard to review when I'm also the author. |
|
I’m gonna create a new PR and take your changes to fix the build on Windows. |
ogham/exa#867