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

🚀 - Locale-utilities for @maskito/kit #814

Open
nsbarsukov opened this issue Dec 22, 2023 · 0 comments
Open

🚀 - Locale-utilities for @maskito/kit #814

nsbarsukov opened this issue Dec 22, 2023 · 0 comments
Labels
feature New feature or request P3 This issue has low priority scope: kit Related to @maskito/kit

Comments

@nsbarsukov
Copy link
Member

nsbarsukov commented Dec 22, 2023

Which package(s) are relevant/related to the feature request?

@maskito/kit

Description

Proposed solution

maskitoLocaleNumber(locale: string): MaskitoOptions {}

// inside maskitoLocaleNumber
const thousandSeparator = new Intl.NumberFormat(locale).format(1000).match(/\D/)[0]
const decimalSeparator = new Intl.NumberFormat(locale).format(0.42).match(/\D/)[0];

return maskitoNumberOptions({decimalSeparator, thousandSeparator});

Usage

import {
    maskitoLocaleNumber,
    maskitoLocaleDate,
    maskitoLocaleDateRange, 
    maskitoLocaleDateTime
} from "@maskito/kit";

const numberOptions = maskitoLocaleNumber(
    'de-DE', 
    {precision: 2} // optionally override any parameter
);
const dateOptions = maskitoLocaleDate('de-DE');
const dateRangeOptions = maskitoLocaleDateRange('de-DE');
const dateTimeOptions = maskitoLocaleDateTime('de-DE');
// [...]

Acceptance criterias

  • Every maskitoLocale*-utility is tested by Cypress Test
  • Every maskitoLocale*-utility has documentation example (e.g. maskitoLocaleNumber is put inside Number documentation page)
@nsbarsukov nsbarsukov added feature New feature or request scope: kit Related to @maskito/kit labels Dec 22, 2023
@github-project-automation github-project-automation bot moved this to 💡 Backlog in Taiga-family Dec 22, 2023
@nsbarsukov nsbarsukov added the P3 This issue has low priority label Jan 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request P3 This issue has low priority scope: kit Related to @maskito/kit
Projects
No open projects
Status: 💡 Backlog
Development

No branches or pull requests

1 participant