* limit date select for todo.

This commit is contained in:
wangyidong
2012-08-28 03:32:36 +00:00
parent 6469d03fab
commit ce25be3c5a
4 changed files with 25 additions and 4 deletions
+10 -1
View File
@@ -20,8 +20,17 @@ Date.abbrDayNames = ['星期天', '星期一', '星期二', '星期三', '星
Date.monthNames = ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'];
$(function() {
var time = $('.date').val();
if(!isNaN(time)){
var Y = time.substring(0, 4);
var m = time.substring(4, 6);
var d = time.substring(6, 8);
time = Y + '-' + m + '-' + d;
$('.date').val(time);
}
startDate = new Date(1970, 1, 1);
$(".date").datePicker({createButton:true, startDate:startDate})
.dpSetPosition($.dpConst.POS_TOP, $.dpConst.POS_RIGHT)
.dpSetPosition($.dpConst.POS_TOP, $.dpConst.POS_RIGHT)
});
</script>
+3 -1
View File
@@ -12,4 +12,6 @@ function updateAction(date)
link = createLink('todo', 'batchCreate', 'date=' + date);
location.href=link;
}
$(function(){
$('.date').dpSetStartDate(new Date());
})
+6 -1
View File
@@ -63,4 +63,9 @@
</table>
</form>
<?php include './footer.html.php';?>
<script language='Javascript'>selectNext();</script>
<script language='Javascript'>
selectNext();
$(function(){
$('.date').dpSetStartDate(new Date());
});
</script>
+6 -1
View File
@@ -66,4 +66,9 @@
</table>
</form>
<?php include './footer.html.php';?>
<script language='Javascript'>switchDateFeature(document.getElementById('dateSwitcher'));</script>
<script language='Javascript'>
switchDateFeature(document.getElementById('dateSwitcher'));
$(function(){
$('.date').dpSetStartDate(new Date());
});
</script>