mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-02-10 02:24:35 +08:00
fix: Display timestamps in user's local timezone in installation scripts
- Convert UTC timestamps to local timezone in install-remote.ps1 - Convert UTC timestamps to local timezone in install-remote.sh - Support cross-platform date conversion (GNU date and BSD date) - Remove 'UTC' suffix from timestamp displays 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -1,10 +1,3 @@
|
|||||||
---
|
|
||||||
name: plan
|
|
||||||
description: 软件架构规划和技术实现计划分析模板
|
|
||||||
category: planning
|
|
||||||
keywords: [规划, 架构, 实现计划, 技术设计, 修改方案]
|
|
||||||
---
|
|
||||||
|
|
||||||
# 软件架构规划模板
|
# 软件架构规划模板
|
||||||
# AI Persona & Core Mission
|
# AI Persona & Core Mission
|
||||||
|
|
||||||
|
|||||||
@@ -416,10 +416,10 @@ function Get-UserVersionChoice {
|
|||||||
$response = Invoke-RestMethod -Uri $apiUrl -UseBasicParsing -TimeoutSec 5
|
$response = Invoke-RestMethod -Uri $apiUrl -UseBasicParsing -TimeoutSec 5
|
||||||
$latestVersion = $response.tag_name
|
$latestVersion = $response.tag_name
|
||||||
|
|
||||||
# Parse and format release date
|
# Parse and format release date to local time
|
||||||
if ($response.published_at) {
|
if ($response.published_at) {
|
||||||
$publishDate = [DateTime]::Parse($response.published_at)
|
$publishDate = [DateTime]::Parse($response.published_at).ToLocalTime()
|
||||||
$latestStableDate = $publishDate.ToString("yyyy-MM-dd HH:mm UTC")
|
$latestStableDate = $publishDate.ToString("yyyy-MM-dd HH:mm")
|
||||||
}
|
}
|
||||||
|
|
||||||
Write-ColorOutput "Latest stable: $latestVersion ($latestStableDate)" $ColorSuccess
|
Write-ColorOutput "Latest stable: $latestVersion ($latestStableDate)" $ColorSuccess
|
||||||
@@ -433,10 +433,10 @@ function Get-UserVersionChoice {
|
|||||||
$commitResponse = Invoke-RestMethod -Uri $commitUrl -UseBasicParsing -TimeoutSec 5
|
$commitResponse = Invoke-RestMethod -Uri $commitUrl -UseBasicParsing -TimeoutSec 5
|
||||||
$latestCommitId = $commitResponse.sha.Substring(0, 7)
|
$latestCommitId = $commitResponse.sha.Substring(0, 7)
|
||||||
|
|
||||||
# Parse and format commit date
|
# Parse and format commit date to local time
|
||||||
if ($commitResponse.commit.committer.date) {
|
if ($commitResponse.commit.committer.date) {
|
||||||
$commitDate = [DateTime]::Parse($commitResponse.commit.committer.date)
|
$commitDate = [DateTime]::Parse($commitResponse.commit.committer.date).ToLocalTime()
|
||||||
$latestCommitDate = $commitDate.ToString("yyyy-MM-dd HH:mm UTC")
|
$latestCommitDate = $commitDate.ToString("yyyy-MM-dd HH:mm")
|
||||||
}
|
}
|
||||||
|
|
||||||
Write-ColorOutput "Latest commit: $latestCommitId ($latestCommitDate)" $ColorSuccess
|
Write-ColorOutput "Latest commit: $latestCommitId ($latestCommitDate)" $ColorSuccess
|
||||||
|
|||||||
@@ -452,14 +452,19 @@ function get_user_version_choice() {
|
|||||||
latest_version=$(echo "$release_data" | jq -r '.tag_name' 2>/dev/null)
|
latest_version=$(echo "$release_data" | jq -r '.tag_name' 2>/dev/null)
|
||||||
local published_at=$(echo "$release_data" | jq -r '.published_at' 2>/dev/null)
|
local published_at=$(echo "$release_data" | jq -r '.published_at' 2>/dev/null)
|
||||||
if [ -n "$published_at" ] && [ "$published_at" != "null" ]; then
|
if [ -n "$published_at" ] && [ "$published_at" != "null" ]; then
|
||||||
# Format: 2025-10-02T04:27:21Z -> 2025-10-02 04:27 UTC
|
# Convert UTC to local time
|
||||||
latest_date=$(echo "$published_at" | sed 's/T/ /' | sed 's/Z/ UTC/' | cut -d'.' -f1)
|
if command -v date &> /dev/null; then
|
||||||
|
latest_date=$(date -d "$published_at" '+%Y-%m-%d %H:%M' 2>/dev/null || date -jf '%Y-%m-%dT%H:%M:%SZ' "$published_at" '+%Y-%m-%d %H:%M' 2>/dev/null)
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
latest_version=$(echo "$release_data" | grep -o '"tag_name":\s*"[^"]*"' | sed 's/"tag_name":\s*"\([^"]*\)"/\1/')
|
latest_version=$(echo "$release_data" | grep -o '"tag_name":\s*"[^"]*"' | sed 's/"tag_name":\s*"\([^"]*\)"/\1/')
|
||||||
local published_at=$(echo "$release_data" | grep -o '"published_at":\s*"[^"]*"' | sed 's/"published_at":\s*"\([^"]*\)"/\1/')
|
local published_at=$(echo "$release_data" | grep -o '"published_at":\s*"[^"]*"' | sed 's/"published_at":\s*"\([^"]*\)"/\1/')
|
||||||
if [ -n "$published_at" ]; then
|
if [ -n "$published_at" ]; then
|
||||||
latest_date=$(echo "$published_at" | sed 's/T/ /' | sed 's/Z/ UTC/' | cut -d'.' -f1)
|
# Convert UTC to local time
|
||||||
|
if command -v date &> /dev/null; then
|
||||||
|
latest_date=$(date -d "$published_at" '+%Y-%m-%d %H:%M' 2>/dev/null || date -jf '%Y-%m-%dT%H:%M:%SZ' "$published_at" '+%Y-%m-%d %H:%M' 2>/dev/null)
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
@@ -480,13 +485,19 @@ function get_user_version_choice() {
|
|||||||
commit_id=$(echo "$commit_data" | jq -r '.sha' 2>/dev/null | cut -c1-7)
|
commit_id=$(echo "$commit_data" | jq -r '.sha' 2>/dev/null | cut -c1-7)
|
||||||
local committer_date=$(echo "$commit_data" | jq -r '.commit.committer.date' 2>/dev/null)
|
local committer_date=$(echo "$commit_data" | jq -r '.commit.committer.date' 2>/dev/null)
|
||||||
if [ -n "$committer_date" ] && [ "$committer_date" != "null" ]; then
|
if [ -n "$committer_date" ] && [ "$committer_date" != "null" ]; then
|
||||||
commit_date=$(echo "$committer_date" | sed 's/T/ /' | sed 's/Z/ UTC/' | cut -d'.' -f1)
|
# Convert UTC to local time
|
||||||
|
if command -v date &> /dev/null; then
|
||||||
|
commit_date=$(date -d "$committer_date" '+%Y-%m-%d %H:%M' 2>/dev/null || date -jf '%Y-%m-%dT%H:%M:%SZ' "$committer_date" '+%Y-%m-%d %H:%M' 2>/dev/null)
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
commit_id=$(echo "$commit_data" | grep -o '"sha":\s*"[^"]*"' | head -1 | sed 's/"sha":\s*"\([^"]*\)"/\1/' | cut -c1-7)
|
commit_id=$(echo "$commit_data" | grep -o '"sha":\s*"[^"]*"' | head -1 | sed 's/"sha":\s*"\([^"]*\)"/\1/' | cut -c1-7)
|
||||||
local committer_date=$(echo "$commit_data" | grep -o '"date":\s*"[^"]*"' | head -1 | sed 's/"date":\s*"\([^"]*\)"/\1/')
|
local committer_date=$(echo "$commit_data" | grep -o '"date":\s*"[^"]*"' | head -1 | sed 's/"date":\s*"\([^"]*\)"/\1/')
|
||||||
if [ -n "$committer_date" ]; then
|
if [ -n "$committer_date" ]; then
|
||||||
commit_date=$(echo "$committer_date" | sed 's/T/ /' | sed 's/Z/ UTC/' | cut -d'.' -f1)
|
# Convert UTC to local time
|
||||||
|
if command -v date &> /dev/null; then
|
||||||
|
commit_date=$(date -d "$committer_date" '+%Y-%m-%d %H:%M' 2>/dev/null || date -jf '%Y-%m-%dT%H:%M:%SZ' "$committer_date" '+%Y-%m-%d %H:%M' 2>/dev/null)
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user