question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add a date format mask to md-datepicker

See original GitHub issue

How to add a dateformat mask to md-datepicker ?

If I specify date format as DD/MM/YYYY , then once user start to type inside datepicker, user will be able to insert

DD upto 31 MM upto 12 YYYY upto 9999 with separate /

so final result like following

A correct date with __/__/____ mask.

currently once I try to insert this like following its not applying

<md-form-field>
  <input mdInput [mdDatepicker]="picker" placeholder="Choose a date" ui-mask="XX.XX.XXXX">
  <md-datepicker-toggle mdSuffix [for]="picker"></md-datepicker-toggle>
  <md-datepicker #picker></md-datepicker>
</md-form-field>

SO I tried following approaches, none of this work

ui-mask="XX.XX.XXXX" os-mask="3?9/19/9999" MASK="DD/MM/YYYY"

Plunkr Example

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
tinykingcommented, Nov 2, 2017

@FilipLaurentiu no, I need format result of mat-datepicker like ‘yyyyMMdd’, but no docment and example. so sad

0reactions
angular-automatic-lock-bot[bot]commented, Sep 7, 2019

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

Read more comments on GitHub >

github_iconTop Results From Across the Web

DatePicker with InputMask - CodePen
Adding Classes. In CodePen, whatever you write in the HTML editor is what goes within the <body> tags in a basic HTML5 template....
Read more >
Inputmask for DatePicker - Mendix Forum
While it currently is possible to type in the date in the datepicker, you have to manually add the dashes or slashes in...
Read more >
jquery datepicker and jquery mask not working - Stack Overflow
I have this piece of code that uses jquery datepicker and jquery masked input. jQuery(function($) { $(document).on('click', '#date', ...
Read more >
Datepicker with input text mask | JavaScript - EJ 2 Forums
I've set an function to created property on datepicker to create a input text mask. The mask appears on the input, but does...
Read more >
Date format mask is not applied to date picker — oracle-tech
Since the format mask of the Date Picker is DD/MM/YYYY, it then saves 09 January 2022 to the database. Example 2: Date: 13...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found