Details
-
Bug
-
Status: Closed
-
Trivial
-
Resolution: Won't Fix
-
2.0.x
-
None
-
None
Description
When the mask of an aui-datepicker, which is triggered by an input text box, contains "%e" and values below 10 are selected, an extra space is included before the date. For example, if the mask "%m/%e/%y" is used and the 9th of October in 2013 is selected from the date picker, the date output in the textbox will appear as "8/ 9/13" rather than "8/9/13".
Steps to reproduce:
1. Paste this code into an .html file:
<html> <head> <script src="http://cdn.alloyui.com/2.0.0/aui/aui-min.js"></script> <link href="http://cdn.alloyui.com/2.0.0/aui-css/css/bootstrap.min.css" rel="stylesheet"></link> </head> <body> <input id="datePicker" type="text"> <script type="text/javascript"> YUI().use( 'aui-datepicker', function(Y) { var datePicker = new Y.DatePicker({ trigger : '#datePicker', mask : '%e', on : { selectionChange : function(event) { console.log(event.newSelection) } } }); } ); </script> </body> </html>
2. Load your .html file in a browser.
3. Click the input text box.
4. Select a date with a day number that is less than 10 in the popup aui-datepicker.
If the bug still exists, a space will appear before the date.