chore: add and update gitignore rules for project files
add a comprehensive gitignore file to exclude unnecessary files like dependencies, runtime data, uploads, local configs and debug temporary files
This commit is contained in:
@@ -567,6 +567,17 @@ const renderWeather = weather => {
|
||||
const adviceText = escapeHtml(weather.advice_text || '暂无建议')
|
||||
const weatherIcon = getWeatherIcon(weather.icon)
|
||||
|
||||
// 转换 data_gateway 更新时间为北京时间
|
||||
const formatBeijingTime = (utcStr) => {
|
||||
if (!utcStr) return ''
|
||||
const d = new Date(utcStr.replace(' ', 'T') + '+00:00')
|
||||
if (isNaN(d.getTime())) return ''
|
||||
const pad = n => String(n).padStart(2, '0')
|
||||
return `${d.getFullYear()}-${pad(d.getMonth()+1)}-${pad(d.getDate())} ${pad(d.getHours())}:${pad(d.getMinutes())}:${pad(d.getSeconds())}.${pad(d.getMilliseconds())}`
|
||||
}
|
||||
const dataTimestamp = formatBeijingTime(weather._data_gateway_updated_at)
|
||||
const dataSourceLabel = dataTimestamp ? `数据更新:${dataTimestamp}` : ''
|
||||
|
||||
// 检查温度是否已经包含°C,如果没有则添加
|
||||
if (temp && !temp.includes('°C')) {
|
||||
temp = temp + '°C'
|
||||
@@ -602,6 +613,7 @@ const renderWeather = weather => {
|
||||
|
||||
<div class="weather-advice">
|
||||
<div class="advice-text" id="advice-text">${adviceText}</div>
|
||||
${dataSourceLabel ? `<div class="weather-data-timestamp">${escapeHtml(dataSourceLabel)}</div>` : ''}
|
||||
<button class="expand-btn" id="expand-advice-btn">展开</button>
|
||||
</div>
|
||||
`
|
||||
|
||||
Reference in New Issue
Block a user