Add 'last changed' tooltip to bookability date headers
Separate verified_at (last checked) from valid_from (last rate change) in the matrix response. Column headers show when rates were last checked; hovering shows both "Checked: X" and "Changed: Y" so users can distinguish a manual refresh that verified unchanged rates from one that found new prices. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
418e0d2fcc
commit
ed0a027448
2 changed files with 30 additions and 14 deletions
|
|
@ -45,6 +45,7 @@ interface RateMatrixData {
|
|||
dates: string[]
|
||||
matrix: Record<string, Record<string, DateRateInfo>>
|
||||
date_last_updated?: Record<string, string | null>
|
||||
date_last_changed?: Record<string, string | null>
|
||||
}
|
||||
|
||||
// Helper functions
|
||||
|
|
@ -432,7 +433,15 @@ const Bookability: React.FC = () => {
|
|||
{refreshingDate === dateStr ? '...' : '↻'}
|
||||
</button>
|
||||
{data.date_last_updated?.[dateStr] && (
|
||||
<span style={styles.lastUpdated} title={`Rates last fetched: ${data.date_last_updated[dateStr]}`}>
|
||||
<span
|
||||
style={styles.lastUpdated}
|
||||
title={[
|
||||
`Checked: ${new Date(data.date_last_updated[dateStr]!).toLocaleString('en-GB')}`,
|
||||
data.date_last_changed?.[dateStr]
|
||||
? `Changed: ${new Date(data.date_last_changed[dateStr]!).toLocaleString('en-GB')}`
|
||||
: null,
|
||||
].filter(Boolean).join('\n')}
|
||||
>
|
||||
{formatLastUpdated(data.date_last_updated[dateStr])}
|
||||
</span>
|
||||
)}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue