Skip to content
This repository was archived by the owner on Sep 9, 2025. It is now read-only.

Commit 7e8eb52

Browse files
Merge pull request #202 from github/what-year-is-it
2 parents 22ed41c + d2de8e9 commit 7e8eb52

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

tree-sitter-stack-graphs/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,20 @@ required-features = ["cli"]
2323

2424
[features]
2525
cli = [
26-
"chrono",
2726
"clap",
2827
"colored",
2928
"dialoguer",
3029
"env_logger",
3130
"indoc",
3231
"pathdiff",
3332
"stack-graphs/json",
33+
"time",
3434
"tree-sitter-config",
3535
"walkdir"
3636
]
3737

3838
[dependencies]
3939
anyhow = "1.0"
40-
chrono = { version = "0.4", optional = true }
4140
clap = { version = "3", optional = true, features=["derive"] }
4241
colored = { version = "2.0", optional = true }
4342
controlled-option = ">=0.4"
@@ -53,6 +52,7 @@ regex = "1"
5352
rust-ini = "0.18"
5453
stack-graphs = { version="0.10", path="../stack-graphs" }
5554
thiserror = "1.0"
55+
time = { version = "0.3", optional = true }
5656
tree-sitter = ">= 0.19"
5757
tree-sitter-config = { version = "0.19", optional = true }
5858
tree-sitter-graph = "0.7"

tree-sitter-stack-graphs/src/cli/init.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
// ------------------------------------------------------------------------------------------------
77

88
use anyhow::anyhow;
9-
use chrono::Datelike;
109
use clap::Args;
1110
use clap::ValueHint;
1211
use dialoguer::Input;
@@ -21,6 +20,7 @@ use std::fs::File;
2120
use std::io::Write;
2221
use std::path::Path;
2322
use std::path::PathBuf;
23+
use time::OffsetDateTime;
2424

2525
use self::license::lookup_license;
2626
use self::license::DEFAULT_LICENSES;
@@ -445,7 +445,7 @@ impl ProjectSettings {
445445
NO_LICENSE | OTHER_LICENSE => {}
446446
selected => {
447447
let mut file = File::create(project_path.join("LICENSE"))?;
448-
let year = chrono::Utc::now().year();
448+
let year = OffsetDateTime::now_utc().year();
449449
let author = self.license_author();
450450
(DEFAULT_LICENSES[selected].2)(&mut file, year, &author)?;
451451
}
@@ -457,7 +457,7 @@ impl ProjectSettings {
457457
match lookup_license(&self.license) {
458458
NO_LICENSE | OTHER_LICENSE => {}
459459
selected => {
460-
let year = chrono::Utc::now().year();
460+
let year = OffsetDateTime::now_utc().year();
461461
let author = self.license_author();
462462
(DEFAULT_LICENSES[selected].1)(file, year, &author, prefix)?;
463463
}

0 commit comments

Comments
 (0)