How to use the text-mask-addons/dist/textMaskAddons.createAutoCorrectedDatePipe function in text-mask-addons

To help you get started, we’ve selected a few text-mask-addons examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github BioPhoton / angular-formatter-parser / src / text-mask-implementation / textMask.service.ts View on Github external
getConfig(config: ITextMaskConfigOptions, addon?: { name, config }): ITextMaskConfigOptions {
    const safeConfig: ITextMaskConfigOptions = this.getBasicConfig(config);

    const addonName = (addon && 'name' in addon) ? addon.name : '';
    switch (addonName) {
      case 'createNumberMask':
        const numberMask = createNumberMask(addon.config);
        safeConfig.mask = numberMask;
        break;
      case 'emailMask':
        safeConfig.mask = emailMask;
        break;
      case 'createAutoCorrectedDatePipe':
        safeConfig.pipe = createAutoCorrectedDatePipe('mm/dd/yyyy');
        safeConfig.keepCharPositions = true;
        break;
    }


    return safeConfig;
  }