Uploaded image for project: 'PUBLIC - Liferay Alloy UI'
  1. PUBLIC - Liferay Alloy UI
  2. AUI-1089

aui-datepicker outputs an extra space when mask includes %e and date below 10 is selected.

Details

    • Bug
    • Status: Closed
    • Trivial
    • Resolution: Won't Fix
    • 2.0.x
    • None
    • DatePicker
    • 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.

      Attachments

        Activity

          People

            ui_alloy UI Alloy
            kyle.stiemann Kyle Stiemann (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              9 years, 18 weeks, 6 days ago

              Packages

                Version Package