4.20.3: Дата next_show_at в целях-задачах
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 1m37s
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 1m37s
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "play-life-web",
|
||||
"version": "4.20.2",
|
||||
"version": "4.20.3",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
|
||||
@@ -189,6 +189,13 @@
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.condition-task-date {
|
||||
margin-top: 0.125rem;
|
||||
margin-left: calc(16px + 0.5rem);
|
||||
font-size: 0.85rem;
|
||||
color: #6b7280;
|
||||
}
|
||||
|
||||
.condition-progress {
|
||||
margin-top: 0.125rem;
|
||||
margin-left: calc(16px + 0.5rem);
|
||||
|
||||
@@ -416,6 +416,36 @@ function WishlistDetail({ wishlistId, onNavigate, onRefresh, boardId, onClose, p
|
||||
</svg>
|
||||
<span className="condition-text">{conditionText}</span>
|
||||
</div>
|
||||
{/* Показываем дату для целей-задач, если next_show_at > сегодня */}
|
||||
{condition.type === 'task_completion' && condition.task_next_show_at && (() => {
|
||||
const showDate = new Date(condition.task_next_show_at)
|
||||
// Нормализуем дату: устанавливаем время в 00:00:00 в локальном времени
|
||||
const showDateNormalized = new Date(showDate.getFullYear(), showDate.getMonth(), showDate.getDate())
|
||||
|
||||
const today = new Date()
|
||||
const todayNormalized = new Date(today.getFullYear(), today.getMonth(), today.getDate())
|
||||
|
||||
// Показываем только если дата > сегодня
|
||||
if (showDateNormalized.getTime() <= todayNormalized.getTime()) {
|
||||
return null
|
||||
}
|
||||
|
||||
const tomorrowNormalized = new Date(todayNormalized)
|
||||
tomorrowNormalized.setDate(tomorrowNormalized.getDate() + 1)
|
||||
|
||||
let dateText
|
||||
if (showDateNormalized.getTime() === tomorrowNormalized.getTime()) {
|
||||
dateText = 'Завтра'
|
||||
} else {
|
||||
dateText = showDate.toLocaleDateString('ru-RU', { day: 'numeric', month: 'long', year: 'numeric' })
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="condition-task-date">
|
||||
{dateText}
|
||||
</div>
|
||||
)
|
||||
})()}
|
||||
{progress && progress.type === 'points' && !isMet && (
|
||||
<div className="condition-progress">
|
||||
<div className="progress-bar">
|
||||
|
||||
Reference in New Issue
Block a user