fix: show snapshot time in browser time zone (#101) #102

Merged
codex-bot merged 3 commits from fix/101-snapshot-time-local-tz into develop 2026-10-24 11:04:51 +03:00
3 changed files with 9 additions and 5 deletions
Showing only changes of commit 271c83c956 - Show all commits
@@ -413,7 +413,9 @@ describe("stock page", () => {
expect(await screen.findByText("Продажа")).toBeVisible();
expect(screen.getByText("2 шт.")).toBeVisible();
expect(screen.getByText("Цена: 100 ₽")).toBeVisible();
expect(screen.getByText(/02.01.2022, 10:00 UTC/)).toBeVisible();
const snapshotTime = new Intl.DateTimeFormat("ru-RU", { dateStyle: "short", timeStyle: "short" });
const operationTime = snapshotTime.format(new Date("2022-01-02T10:00:00Z"));
expect(screen.getByText(operationTime, { exact: false })).toBeVisible();
expect(
requests.some(
url =>
@@ -93,7 +93,9 @@ describe("stock search", () => {
expect(
await screen.findByRole("link", { name: /Сбербанк/ }),
).toHaveAttribute("href", "/stocks/e6123145-9665-43e0-8413-cd61b8aa9b13");
expect(screen.getByText("Список получен 10.10.2026, 10:00")).toBeVisible();
const snapshotTime = new Intl.DateTimeFormat("ru-RU", { dateStyle: "short", timeStyle: "short" });
const fetchedAt = snapshotTime.format(new Date("2026-10-10T10:00:00Z"));
expect(screen.getByText(`Список получен ${fetchedAt}`)).toBeVisible();
expect(screen.getByText("Лот: 10 шт.")).toBeVisible();
expect(screen.getByText("ISIN: RU0009029540")).toBeVisible();
expect(screen.getAllByText("Мосбиржа")[0]).toBeVisible();
+3 -3
View File
@@ -420,7 +420,7 @@ const ru = {
next: "Далее",
noInstrument: "Без инструмента",
noMoney: "Без движения денег",
occurredAt: "{{date}} UTC",
occurredAt: "{{date}}",
open: "Открыть журнал",
operationType: {
buy: "Покупка",
@@ -632,7 +632,7 @@ const ru = {
position: "Моя позиция",
previous: "Назад",
price: "Цена",
priceAt: "Цена на {{date}} UTC",
priceAt: "Цена на {{date}}",
priceTable: "Цены в таблице",
priceTableHint: "Дневные закрытия · записей: {{count}} · сначала новые",
priceUnavailable: "Цена недоступна",
@@ -721,7 +721,7 @@ const ru = {
SHARE_TYPE_GDR: "Депозитарная расписка",
SHARE_TYPE_PREFERRED: "Привилегированная акция",
},
snapshotAt: "Позиция на {{date}} UTC",
snapshotAt: "Позиция на {{date}}",
trading: {
SECURITY_TRADING_STATUS_BREAK_IN_TRADING: "Перерыв в торгах",
SECURITY_TRADING_STATUS_CLOSING_AUCTION: "Аукцион закрытия",