using jQuery UI Datepickers.
Notice when you select a start date it becomes the min end date
and when you select an end date it becomes the max start date.
<!doctype html>
<html lang="en"><head><title>jQuery UI Datepicker - Restrict date range</title><link type="text/css" href="../../themes/base/ui.all.css" rel="stylesheet" /><script type="text/javascript" src="../../jquery-1.3.2.js"></script><script type="text/javascript" src="../../ui/ui.core.js"></script><script type="text/javascript" src="../../ui/ui.datepicker.js"></script><script type="text/javascript" src="http://www.mattkruse.com/javascript/date/compact/date.js"></script><link type="text/css" href="../demos.css" rel="stylesheet" /><script type="text/javascript">$(function() {$(".startDatepicker").datepicker({showOn: 'button',buttonImage: 'images/calendar.gif',buttonImageOnly: true,dateFormat: "mm/dd/y" ,onSelect: function(dateText) {//alert(dateText);var d = parseDate(dateText);alert(d);$(".endDatepicker").datepicker('option', 'minDate', d);}});$(".endDatepicker").datepicker({showOn: 'button',buttonImage: 'images/calendar.gif',buttonImageOnly: true,dateFormat: "mm/dd/y" ,onSelect: function(dateText) {//alert(dateText);var d = parseDate(dateText);alert(d);$(".startDatepicker").datepicker('option', 'maxDate', d);}});});</script></head><body><div class="demo"><p>Start Date: <input type="text" id="startDatepicker" class="startDatepicker" ></p><p>End Date: <input type="text" id="endDatepicker" class="endDatepicker"></p></div><!-- End demo --></body></html>
Search
just show me the code
Friday, April 24, 2009
My jQuery Date Range
Thursday, April 23, 2009
TFS Fail a build AND create a work item when unit test fails
thanks to http://social.msdn.microsoft.com/forums/en-US/tfsbuild/thread/b6fa6aa8-1861-4cd0-b9bb-4eeb64432651/
229 <Target Name="AfterTest">
230 <!-- Refresh the build properties. -->
231 <GetBuildProperties TeamFoundationServerUrl="$(TeamFoundationServerUrl)"
232 BuildUri="$(BuildUri)"
233 Condition=" '$(IsDesktopBuild)' != 'true' ">
234 <Output TaskParameter="TestSuccess"
235 PropertyName="TestSuccess" />
236 </GetBuildProperties>
237
238 <!-- Set CompilationStatus to Failed if TestSuccess is false. -->
239 <SetBuildProperties TeamFoundationServerUrl="$(TeamFoundationServerUrl)"
240 BuildUri="$(BuildUri)"
241 CompilationStatus="Failed"
242 Condition=" '$(IsDesktopBuild)' != 'true' and '$(TestSuccess)' != 'true' ">
243 </SetBuildProperties>
244 <CreateNewWorkItem
245 BuildNumber="$(BuildNumber)"
246 BuildURi="$(BuildURI)"
247 Description="The CreateNewWorkItem task created this bug."
248 TeamProject="$(TeamProject)"
249 TeamFoundationServerUrl="$(TeamFoundationServerUrl)"
250 Title="Unit Test Failure in $(BuildNumber)"
251 WorkItemFieldValues="$(WorkItemFieldValues)"
252 WorkItemType="$(WorkItemType)"
253 Condition=" '$(IsDesktopBuild)' != 'true' and '$(TestSuccess)' != 'true' ">
254 </CreateNewWorkItem>
255 </Target>
Tuesday, April 14, 2009
Wednesday, April 1, 2009
sweet regular expression tester site
I finally found a sweet regular expression tester. http://regexpal.com/
here is my test for phone number validation which will allow user to enter (xxx)xxx-xxxx or xxx-xxx-xxxx or xxxxxxxxxx
^((((\(\d{3}\)?)|(\d{3}-))?\d{3}-\d{4})|(\d{10}))
234-432-2342
(324)432-0909
(324)6we-0909
(324)63a-0909
234-432-2342
(234)324-5444
3424324234
234-432-2342
2311212321
asdf323243
1231321
1564344445
thanks regexpal
here is my test for phone number validation which will allow user to enter (xxx)xxx-xxxx or xxx-xxx-xxxx or xxxxxxxxxx
^((((\(\d{3}\)?)|(\d{3}-))?\d{3}-\d{4})|(\d{10}))
234-432-2342
(324)432-0909
(324)6we-0909
(324)63a-0909
234-432-2342
(234)324-5444
3424324234
234-432-2342
2311212321
asdf323243
1231321
1564344445
thanks regexpal
Subscribe to:
Posts (Atom)