Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed native date picker by making input type text [#94367846] #15

Closed
wants to merge 1 commit into from
Closed

Removed native date picker by making input type text [#94367846] #15

wants to merge 1 commit into from

Conversation

amir-qayyum-khan
Copy link

Hi

Working for MIT ODL. Previously app was showing 2 date pickers on chrome browser and one date picker on reset of browsers, I have changed input type=date to type=text, now it is showing only customise date picker.

Added a validation, If user enters a date less then 100 , app with change it to val + 2000, means if user enters 0001-2-21 on focus out it will change it to 2001-2-21

jazkarta#63
jazkarta#30
#21

EDX https://github.com/edx/edx-platform/pull/7946
@carsongee @pdpinch @pwilkins

screen shot 2015-05-06 at 3 47 39 pm

@pdpinch pdpinch changed the title Removed native date picker by making input type text Removed native date picker by making input type text [#94367846] May 18, 2015
@pdpinch
Copy link
Member

pdpinch commented May 21, 2015

@pwilkins can you review?

@pdpinch pdpinch modified the milestone: CCX May 27, 2015
@@ -124,5 +124,18 @@
'dateFormat': 'yy-mm-dd',
'autoclose': true
});
$('.datepair .date').change(function() {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why aren't we just using the datepickers methods for grabbing the date object? https://api.jqueryui.com/datepicker/

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@carsongee now using date picker api to grab date, the aim of this PR is to disallow date years like 0001,0002.... Currently date pickers allows date format like 0001-2-23 but javascript and date picker assume it as 2001-2-23, So text field shows date 0001-2-23 but date picker dialog show it as 2001-2-23. It is ambiguous.
in this PR I made date consistent i.e same on both date picker dialog and text field. When use adds date in text field like 0001-2-23 app convert it to 2001-2-23. A valid year.

@amir-qayyum-khan
Copy link
Author

Fixed in #29

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants