Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

6123 - Fix incorrect date format the for the Latvian language #6410

Merged
merged 1 commit into from
May 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions app/views/components/locale/test-format-date.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
<label for="date-field4" class="label">pt-BR</label>
<input id="date-field4" />
</div>
<div class="field">
<label for="date-field5" class="label">pt-BR</label>
<input id="date-field5" />
</div>
</div>
</div>

Expand Down Expand Up @@ -64,5 +68,13 @@
$('#date-field4').val(val);
$('#date-field4').prev('label').text(Soho.Locale.currentLocale.dataName + ' (' + Soho.Locale.currentLocale.data.calendars[0].dateFormat.short + ')');
});

var locale = 'lv-LV';
Soho.Locale.set(locale).done(function(a) {
console.log(Soho.Locale.currentLocale, Soho.Locale.currentLanguage);
const val = Soho.Locale.formatDate(new Date(2019, 11, 5));
$('#date-field5').val(val);
$('#date-field5').prev('label').text(Soho.Locale.currentLocale.dataName + ' (' + Soho.Locale.currentLocale.data.calendars[0].dateFormat.short + ')');
});
});
</script>
1 change: 1 addition & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
- `[Icons]` Fixed the inconsistency between solid and outlined icons. ([#6165](https://github.com/infor-design/enterprise/issues/6165))
- `[Icons]` Changed the error color to change in themes in some areas. ([#6273](https://github.com/infor-design/enterprise/issues/6273))
- `[Listview]` Fixed a bug where the search icon is misaligned in Firefox and Safari. ([#6390](https://github.com/infor-design/enterprise/issues/6390))
- `[Locale]` Fixed incorrect date format for Latvian language. ([#6123](https://github.com/infor-design/enterprise/issues/6123))
- `[WeekView]` Fixed a bug where 'today' date is not being rendered properly. ([#6260](https://github.com/infor-design/enterprise/issues/6260))

## v4.63.0
Expand Down
2 changes: 1 addition & 1 deletion src/components/locale/cultures/lv-LV.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Soho.Locale.addCulture('lv-LV', {
dateFormat: {
separator: '.', // Infered
timeSeparator: ':',
short: 'dd.MM.yyyy', // use four digit year
short: 'dd.MM.yyyy.', // use four digit year
medium: 'MMM yyyy',
long: 'd. MMMM yyyy',
full: 'EEEE, y. gada d. MMMM',
Expand Down
37 changes: 27 additions & 10 deletions test/components/locale/locale.puppeteer-spec.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,34 @@
const { getConfig } = require('../../helpers/e2e-utils.js');

describe('Locale visual test for PH - Translation', () => {
const url = 'http://localhost:4000/components/locale/test-translations.html?locale=tl-PH';
describe('Locale', () => {
const baseUrl = 'http://localhost:4000/components/locale';

beforeAll(async () => {
await page.goto(url, { waitUntil: ['domcontentloaded', 'networkidle0'] });
await page.setViewport({ width: 1920, height: 1080 });
describe('Locale visual test for PH - Translation', () => {
const url = `${baseUrl}/test-translations.html?locale=tl-PH`;

beforeAll(async () => {
await page.goto(url, { waitUntil: ['domcontentloaded', 'networkidle0'] });
await page.setViewport({ width: 1920, height: 1080 });
});

it('should run visual test for locale-ph', async () => {
await page.waitForSelector('#tabs-2');
const img = await page.screenshot();
const config = getConfig('locale-ph');
expect(img).toMatchImageSnapshot(config);
});
});

it('should run visual test for locale-ph', async () => {
await page.waitForSelector('#tabs-2');
const img = await page.screenshot();
const config = getConfig('locale-ph');
expect(img).toMatchImageSnapshot(config);
describe('Locale date format in Latvian tests', () => {
const url = `${baseUrl}/test-format-date.html`;

beforeAll(async () => {
await page.goto(url, { waitUntil: ['domcontentloaded', 'networkidle0'] });
});

it('should show the correct date format for Latvian', async () => {
await page.evaluate(() => document.querySelector('#date-field5').value)
.then(value => expect(value).toEqual('05.12.2019.'));
});
});
});