Goals -System refactored - Platzhaltersystem enhanced (als draft) #53

Merged
Lars merged 86 commits from develop into main 2026-03-31 11:46:48 +02:00
Showing only changes of commit 3604ebc781 - Show all commits

View File

@ -196,7 +196,7 @@ export default function GoalsPage() {
priority: goal.priority || 2,
target_value: goal.target_value,
unit: goal.unit,
start_date: goal.start_date || new Date().toISOString().split('T')[0],
start_date: goal.start_date || '', // Load actual date or empty (not today!)
target_date: goal.target_date || '',
name: goal.name || '',
description: goal.description || '',
@ -683,14 +683,24 @@ export default function GoalsPage() {
<span style={{ color: 'var(--text2)' }}>Ziel:</span>{' '}
<strong style={{ color: catInfo.color }}>{goal.target_value} {goal.unit}</strong>
</div>
{goal.target_date && (
<div style={{ color: 'var(--text2)' }}>
<Calendar size={14} style={{ verticalAlign: 'middle', marginRight: 4 }} />
{dayjs(goal.target_date).format('DD.MM.YYYY')}
</div>
)}
</div>
{/* Timeline: Start → Ziel */}
{(goal.start_date || goal.target_date) && (
<div style={{ display: 'flex', gap: 12, fontSize: 13, color: 'var(--text2)', marginBottom: 12, alignItems: 'center' }}>
{goal.start_date && (
<>
<Calendar size={13} style={{ verticalAlign: 'middle' }} />
<span>{dayjs(goal.start_date).format('DD.MM.YY')}</span>
</>
)}
{goal.start_date && goal.target_date && <span></span>}
{goal.target_date && (
<span style={{ fontWeight: 500 }}>{dayjs(goal.target_date).format('DD.MM.YY')}</span>
)}
</div>
)}
{goal.progress_pct !== null && (
<div>
<div style={{
@ -1108,7 +1118,7 @@ export default function GoalsPage() {
type="date"
className="form-input"
style={{ width: '100%', textAlign: 'left' }}
value={formData.start_date || new Date().toISOString().split('T')[0]}
value={formData.start_date || ''}
onChange={e => setFormData(f => ({ ...f, start_date: e.target.value }))}
/>
<div style={{ fontSize: 12, color: 'var(--text3)', marginTop: 4 }}>