Skip to content

Commit

Permalink
Merge pull request #52 from worksoup/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
worksoup authored Dec 8, 2024
2 parents 1dc911e + 12281ba commit 6289fed
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ jobs:
steps:
- uses: actions/checkout@v2
with:
submodules: true
submodules: true
- name: Install libdbus-1-dev
run: sudo apt update && sudo apt-get install -yqq libdbus-1-dev
- name: Install latest nightly
uses: crusty-pie/toolchain@v1
with:
toolchain: nightly
override: true
components: clippy
toolchain: nightly
override: true
components: clippy
- name: Run cargo check
uses: clechasseur/rs-cargo@v2
with:
Expand All @@ -57,7 +57,7 @@ jobs:
include:
- { os: ubuntu-latest }
- { os: windows-2022 }
- { os: macos-12 }
- { os: macos-13 }
name: ${{ format('{0}', matrix.os) }}
runs-on: ${{ matrix.os }}
steps:
Expand All @@ -70,8 +70,8 @@ jobs:
- name: Install latest nightly
uses: crusty-pie/toolchain@v1
with:
toolchain: nightly
override: true
toolchain: nightly
override: true
- name: Run cargo build
uses: clechasseur/rs-cargo@v2
with:
Expand Down
10 changes: 6 additions & 4 deletions src/cli/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ use cxlib::{
};
use log::{info, warn};
use std::collections::HashMap;
use std::time::Duration;

fn match_signs(
raw_sign: RawSign,
Expand Down Expand Up @@ -194,10 +195,11 @@ pub fn do_sign(
"即将处理签到:[{}], id 为 {}, 开始时间为 {}, 课程为 {} / {} / {}",
sign.name,
sign.active_id,
chrono::DateTime::from_timestamp_millis(sign.start_time_mills as i64)
.unwrap()
.naive_local()
.to_string(),
chrono::DateTime::<chrono::Local>::from(
std::time::UNIX_EPOCH + Duration::from_millis(sign.start_time_mills)
)
.format("%+")
.to_string(),
sign.course.get_class_id(),
sign.course.get_id(),
sign.course.get_name()
Expand Down

0 comments on commit 6289fed

Please sign in to comment.