aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/repository/vcs/forgejo_driver.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-06-09 00:00:12 +0900
committernsfisis <nsfisis@gmail.com>2026-06-09 00:00:49 +0900
commit1c0eb589741de4aa52ef941ff9315b34dbe48aa0 (patch)
tree8d821cf3a7fb3f8c753dec7861ad9597f6948493 /crates/shirabe/src/repository/vcs/forgejo_driver.rs
parente5b789616ec4c1cbd152c5ccbefe2d27ced4a18f (diff)
downloadphp-shirabe-1c0eb589741de4aa52ef941ff9315b34dbe48aa0.tar.gz
php-shirabe-1c0eb589741de4aa52ef941ff9315b34dbe48aa0.tar.zst
php-shirabe-1c0eb589741de4aa52ef941ff9315b34dbe48aa0.zip
feat(datetime): resolve datetime TODOs
Introduce shim functions and constants, replacing the ad-hoc chrono format strings and parse helpers used as phase-b placeholders. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/repository/vcs/forgejo_driver.rs')
-rw-r--r--crates/shirabe/src/repository/vcs/forgejo_driver.rs9
1 files changed, 4 insertions, 5 deletions
diff --git a/crates/shirabe/src/repository/vcs/forgejo_driver.rs b/crates/shirabe/src/repository/vcs/forgejo_driver.rs
index a40f6a9..73975cd 100644
--- a/crates/shirabe/src/repository/vcs/forgejo_driver.rs
+++ b/crates/shirabe/src/repository/vcs/forgejo_driver.rs
@@ -5,7 +5,7 @@ use anyhow::Result;
use indexmap::IndexMap;
use shirabe_external_packages::composer::pcre::{CaptureKey, Preg};
use shirabe_php_shim::{
- PhpMixed, RuntimeException, base64_decode, explode, extension_loaded, urlencode,
+ DATE_RFC3339, PhpMixed, RuntimeException, base64_decode, explode, extension_loaded, urlencode,
};
use crate::cache::Cache;
@@ -185,7 +185,7 @@ impl ForgejoDriver {
pub fn get_change_date(
&mut self,
identifier: &str,
- ) -> Result<Option<chrono::DateTime<chrono::Utc>>> {
+ ) -> Result<Option<chrono::DateTime<chrono::FixedOffset>>> {
if let Some(ref mut git_driver) = self.git_driver {
return git_driver.get_change_date(identifier);
}
@@ -218,8 +218,7 @@ impl ForgejoDriver {
code: 0,
})?;
- let date = chrono::DateTime::parse_from_rfc3339(&date_str)
- .map(|d| d.with_timezone(&chrono::Utc))?;
+ let date: chrono::DateTime<chrono::FixedOffset> = shirabe_php_shim::date_create(&date_str)?;
Ok(Some(date))
}
@@ -725,7 +724,7 @@ impl crate::repository::vcs::VcsDriverInterface for ForgejoDriver {
fn get_change_date(
&mut self,
identifier: &str,
- ) -> anyhow::Result<Option<chrono::DateTime<chrono::Utc>>> {
+ ) -> anyhow::Result<Option<chrono::DateTime<chrono::FixedOffset>>> {
ForgejoDriver::get_change_date(self, identifier)
}