• U universo-react
  • Информация о проекте
    • Информация о проекте
    • Активность
    • Метки
    • Участники
  • Репозиторий
    • Репозиторий
    • Файлы
    • Коммиты
    • Ветки
    • Теги
    • Участники
    • Диаграмма
    • Сравнение
  • Задачи 25
    • Задачи 25
    • Список
    • Доски
    • Спринты
  • Запросы на слияние 0
    • Запросы на слияние 0
  • CI/CD
    • CI/CD
    • Конвейеры
    • Задания
    • Расписания
  • Развертывания
    • Развертывания
    • Окружения
    • Релизы
  • Пакеты и реестры
    • Пакеты и реестры
    • Реестр пакетов
    • Реестр контейнеров
  • Мониторинг
    • Мониторинг
    • Инциденты
  • Аналитика
    • Аналитика
    • Поток ценности
    • CI/CD
    • Репозиторий
  • Wiki
    • Wiki
  • Сниппеты
    • Сниппеты
  • Активность
  • Диаграмма
  • Создать новую задачу
  • Задания
  • Коммиты
  • Доски с задачами
Свернуть панель
  • Teknokomo
  • universo-react
  • Репозиторий
Выбрать ветку (тег)
  • universo-react
  • packages
  • frontend
  • i18n
  • src
  • index.ts
Найти файл Показать деталиИсторияПостоянная ссылка
  • akumatus's avatar
    feat: history timeline shows relative time, such as today and yesterday (#6864)
    · 261d4136
    akumatus создал Май 13, 2024
    ### TL;DR
    First, fixed an i18n issue in history panel. When the browser language is set to Chinese, and the AFFiNE application language is set to English, the language supposed to be English global. But now the language is a mixture of Chinese and English, which is obviously wrong.
    
    ![截屏2024-05-08 18.23.21.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/sJGviKxfE3Ap685cl5bj/93d8218a-3b26-4b0c-9f15-71a8996556db.png)
    
    Second, design a time formatter to convert timestamp into relative calendar date, such today and yesterday and so on. Long-ago edits will show the exact date like before.
    
    ![截屏2024-05-10 15.30.57.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/sJGviKxfE3Ap685cl5bj/dbc59e80-9504-40b1-b712-5c155cb6fa63.png)
    
    ### What changed?
    - `new Intl.DateTimeFormat` with language option form  `document.documentElement.lang`
    - Added `timestampToCalendarDate` function to convert timestamp into relative calendar date
    - Updated unit tests
    - Updated i18n copywriting
    
    ### How to test?
    1. Open view history version
    2. Check edit timeline
    261d4136