Answered by:
How to clear a WinJS datepicker?

Question
-
Is there any way to create an optional date field using a WinJS.UI.DatePicker control? I cant find a way to clear/empty the value of the control. It contains the current date by default however I would like it to be empty by default.
Nimrodx
Tuesday, April 1, 2014 8:12 AM
Answers
-
You have full access to the control in ui.js
You could in theory simply copy that code into your project and modify it the way you want. _updateDisplay would be the only thing you need to alter. Have an member you can set to (no default) and test for that in _updateDisplay to take customer action.
Jeff Sanders (MSFT)
@jsandersrocks - Windows Store Developer Solutions @WSDevSol
Getting Started With Windows Azure Mobile Services development? Click here
Getting Started With Windows Phone or Store app development? Click here
My Team Blog: Windows Store & Phone Developer Solutions
My Blog: Http Client Protocol Issues (and other fun stuff I support)- Proposed as answer by Jeff SandersMicrosoft employee, Moderator Wednesday, April 2, 2014 12:56 PM
- Marked as answer by Dibran Mulder Wednesday, April 2, 2014 1:21 PM
Wednesday, April 2, 2014 12:56 PMModerator
All replies
-
There is not.
How about hide it unless the customer wants to enter a date?
Jeff Sanders (MSFT)
@jsandersrocks - Windows Store Developer Solutions @WSDevSol
Getting Started With Windows Azure Mobile Services development? Click here
Getting Started With Windows Phone or Store app development? Click here
My Team Blog: Windows Store & Phone Developer Solutions
My Blog: Http Client Protocol Issues (and other fun stuff I support)Tuesday, April 1, 2014 7:39 PMModerator -
I appreciate your help but this really sucks big time, i'm forced to use a third party library now. Mobiscroll looks like a Windows themed control, ill try that. Or do you have any better libraries? Thanks for your reply!
Nimrodx
Wednesday, April 2, 2014 7:27 AM -
You have full access to the control in ui.js
You could in theory simply copy that code into your project and modify it the way you want. _updateDisplay would be the only thing you need to alter. Have an member you can set to (no default) and test for that in _updateDisplay to take customer action.
Jeff Sanders (MSFT)
@jsandersrocks - Windows Store Developer Solutions @WSDevSol
Getting Started With Windows Azure Mobile Services development? Click here
Getting Started With Windows Phone or Store app development? Click here
My Team Blog: Windows Store & Phone Developer Solutions
My Blog: Http Client Protocol Issues (and other fun stuff I support)- Proposed as answer by Jeff SandersMicrosoft employee, Moderator Wednesday, April 2, 2014 12:56 PM
- Marked as answer by Dibran Mulder Wednesday, April 2, 2014 1:21 PM
Wednesday, April 2, 2014 12:56 PMModerator