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

fix:ms-dos date format #84

Merged
merged 2 commits into from
May 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Changelog

- [Changelog](#changelog)
- [6.0.1](#601)
- [6.0.0](#600)
- [5.4.0](#540)
- [5.3.1](#531)
Expand Down Expand Up @@ -33,6 +34,12 @@

---

## 6.0.1

Released on 24/05/2024

- [PR 84](https://github.com/veeso/suppaftp/pull/84): LIST with DOS lines parsed `%d-%m` but the correct syntax is `%m-%d`

## 6.0.0

Released on 20/05/2024
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ members = ["suppaftp", "suppaftp-cli"]
resolver = "2"

[workspace.package]
version = "6.0.0"
version = "6.0.1"
edition = "2021"
authors = [
"Christian Visintin <christian.visintin@veeso.dev>",
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</p>

<p align="center">Developed by <a href="https://veeso.github.io/">veeso</a> and <a href="https://github.com/mattnenterprise">Matt McCoy</a></p>
<p align="center">Current version: 6.0.0 (20/05/2024)</p>
<p align="center">Current version: 6.0.1 (24/05/2024)</p>

<p align="center">
<a href="https://opensource.org/licenses/MIT"
Expand Down
10 changes: 5 additions & 5 deletions suppaftp/src/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -478,9 +478,9 @@ impl File {
.unwrap_or(SystemTime::UNIX_EPOCH))
}

/// Parse date time string in DOS representation ("%d-%m-%y %I:%M%p")
/// Parse date time string in DOS representation ("%m-%d-%y %I:%M%p")
fn parse_dostime(tm: &str) -> Result<SystemTime, ParseError> {
NaiveDateTime::parse_from_str(tm, "%d-%m-%y %I:%M%p")
NaiveDateTime::parse_from_str(tm, "%m-%d-%y %I:%M%p")
.map(|dt| {
SystemTime::UNIX_EPOCH
.checked_add(Duration::from_secs(dt.and_utc().timestamp() as u64))
Expand Down Expand Up @@ -810,7 +810,7 @@ mod test {
.duration_since(SystemTime::UNIX_EPOCH)
.ok()
.unwrap(),
Duration::from_secs(1407164940)
Duration::from_secs(1396969740)
);
// Parse directory
let dir: File = File::try_from("04-08-14 03:09PM <DIR> docs")
Expand All @@ -834,7 +834,7 @@ mod test {
.duration_since(SystemTime::UNIX_EPOCH)
.ok()
.unwrap(),
Duration::from_secs(1407164940)
Duration::from_secs(1396969740)
);
// Error
assert_eq!(
Expand Down Expand Up @@ -942,7 +942,7 @@ mod test {
.duration_since(SystemTime::UNIX_EPOCH)
.ok()
.unwrap(),
Duration::from_secs(1407164940)
Duration::from_secs(1396969740)
);
// Not enough argument for datetime
assert!(File::parse_dostime("04-08-14").is_err());
Expand Down
Loading