Skip to content

test(@formatjs/intl-datetimeformat): add test for #4270#5931

Merged
longlho merged 1 commit intomainfrom
01-15-test_formatjs_intl-datetimeformat_add_test_for_4270
Jan 15, 2026
Merged

test(@formatjs/intl-datetimeformat): add test for #4270#5931
longlho merged 1 commit intomainfrom
01-15-test_formatjs_intl-datetimeformat_add_test_for_4270

Conversation

@longlho
Copy link
Copy Markdown
Member

@longlho longlho commented Jan 15, 2026

TL;DR

Add Bosnian (bs) locale support to DateTimeFormat to fix month formatting issues.

What changed?

  • Added Bosnian (bs) locale to the test locales in BUILD.bazel
  • Added Bosnian locale data (bs.json) with proper month names and formatting rules
  • Added a test case that verifies Bosnian month formatting works correctly
  • Updated the DateTimeFormat.__addLocaleData call to include the new Bosnian locale

How to test?

Run the new test case that verifies Bosnian month formatting:

// Test for issue #4270: Bosnian month formatting
describe('Bosnian month formatting (issue #4270)', function () {
  it('should format with full datetime options including long month', function () {
    const date = new Date(Date.UTC(2024, 10, 15, 14, 30, 45));
    const fmt = new DateTimeFormat('bs-BA', {
      weekday: 'long',
      year: 'numeric',
      month: 'long',
      day: 'numeric',
      hour: 'numeric',
      minute: 'numeric',
      second: 'numeric',
      timeZone: 'UTC',
    });

    const result = fmt.format(date);
    expect(result).toBe('petak, 15. novembar 2024., 14:30:45');
  });
});

Why make this change?

This change fixes issue #4270 where Bosnian month formatting was not working correctly. Previously, Bosnian dates would display month numbers (like "M11") instead of the proper month names (like "novembar"). By adding the Bosnian locale data with correct month names and formatting rules, dates can now be properly formatted in Bosnian.

This was referenced Jan 15, 2026
Copy link
Copy Markdown
Member Author

longlho commented Jan 15, 2026

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • main - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has required the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@longlho longlho marked this pull request as ready for review January 15, 2026 15:51
@graphite-app graphite-app bot changed the base branch from 01-15-docs_convert_rich_text_formatting_to_static_example_fix_4360 to graphite-base/5931 January 15, 2026 16:00
@graphite-app graphite-app bot force-pushed the graphite-base/5931 branch from 65d39c1 to 6e243c7 Compare January 15, 2026 16:00
@graphite-app graphite-app bot force-pushed the 01-15-test_formatjs_intl-datetimeformat_add_test_for_4270 branch from 734d1c0 to 04d5e7b Compare January 15, 2026 16:00
@graphite-app graphite-app bot changed the base branch from graphite-base/5931 to main January 15, 2026 16:01
@graphite-app graphite-app bot force-pushed the 01-15-test_formatjs_intl-datetimeformat_add_test_for_4270 branch from 04d5e7b to 560dbf0 Compare January 15, 2026 16:01
@longlho longlho merged commit c9d03b5 into main Jan 15, 2026
6 checks passed
@longlho longlho deleted the 01-15-test_formatjs_intl-datetimeformat_add_test_for_4270 branch January 15, 2026 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant