Text-mask: trouble with createCorrectedDatePipe plugin

Created on 19 Apr 2017  路  1Comment  路  Source: text-mask/text-mask

i'm having trouble with implementing createCorrectedDatePipe plugin. this is my setup

<script src="vanillaTextMask.js"></script>
<script src="createAutoCorrectedDatePipe.js"></script>

<script>
  var autoCorrectedDatePipe = createAutoCorrectedDatePipe('mm/dd/yyyy')

  vanillaTextMask.maskInput({
    inputElement: el,
    mask: autoCorrectedDatePipe
});
</script>

i'm getting

da42fc1_vanillaTextMask_1.js?v1.5:1 Uncaught TypeError: e.indexOf is not a function
addons question

Most helpful comment

autoCorrectedDatePipe is a pipe, not a mask.

vanillaTextMask.maskInput({
  inputElement: el,
  mask: [/\d/, /\d/, '/', /\d/, /\d/, '/', /\d/, /\d/, /\d/, /\d/],
  pipe: autoCorrectedDatePipe
});

Hope that helps.. feel free to re-open the issue if you have any other related questions

>All comments

autoCorrectedDatePipe is a pipe, not a mask.

vanillaTextMask.maskInput({
  inputElement: el,
  mask: [/\d/, /\d/, '/', /\d/, /\d/, '/', /\d/, /\d/, /\d/, /\d/],
  pipe: autoCorrectedDatePipe
});

Hope that helps.. feel free to re-open the issue if you have any other related questions

Was this page helpful?
0 / 5 - 0 ratings

Related issues

badre429 picture badre429  路  3Comments

skube picture skube  路  3Comments

cargonsan picture cargonsan  路  4Comments

gabrielamarques picture gabrielamarques  路  6Comments

jvbianchi picture jvbianchi  路  5Comments