+ add the date plugin.
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/header.html.php';?>
|
||||
<?php include '../../common/datepicker.html.php';?>
|
||||
<div class='yui-d0'>
|
||||
<form method='post' target='hiddenwin'>
|
||||
<table class='table-1'>
|
||||
@@ -41,7 +42,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->build->date;?></th>
|
||||
<td><input type='text' name='date' class='text-3' value='<?php echo date('Y-m-d');?>' /></td>
|
||||
<td><input type='text' name='date' class='text-3 date' value='<?php echo date('Y-m-d');?>' /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->build->scmPath;?></th>
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/header.html.php';?>
|
||||
<?php include '../../common/datepicker.html.php';?>
|
||||
<div class='yui-d0'>
|
||||
<form method='post' target='hiddenwin'>
|
||||
<table class='table-1'>
|
||||
@@ -41,7 +42,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->build->date;?></th>
|
||||
<td><input type='text' name='date' class='text-3' value='<?php echo $build->date;?>' /></td>
|
||||
<td><input type='text' name='date' class='text-3 date' value='<?php echo $build->date;?>' /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->build->scmPath;?></th>
|
||||
|
||||
28
trunk/module/common/datepicker.html.php
Normal file
28
trunk/module/common/datepicker.html.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<link rel='stylesheet' href='<?php echo $clientTheme;?>datepicker.css' type='text/css' />
|
||||
<script src='<?php echo $jsRoot;?>jquery/datepicker/min.js' type='text/javascript'></script>
|
||||
<script src='<?php echo $jsRoot;?>jquery/datepicker/date.js' type='text/javascript'></script>
|
||||
<script language='javascript'>
|
||||
Date.firstDayOfWeek = 1;
|
||||
Date.format = 'yyyy-mm-dd';
|
||||
$.dpText = {
|
||||
TEXT_PREV_YEAR : '去年',
|
||||
TEXT_PREV_MONTH : '上个月',
|
||||
TEXT_NEXT_YEAR : '明年',
|
||||
TEXT_NEXT_MONTH : '下个月',
|
||||
TEXT_CLOSE : '关闭',
|
||||
TEXT_CHOOSE_DATE : '...'
|
||||
}
|
||||
Date.dayNames = ['日', '一', '二', '三', '四', '五', '六'];
|
||||
Date.abbrDayNames = ['星期天', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'];
|
||||
Date.monthNames = ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'];
|
||||
|
||||
$(function() {$(".date")
|
||||
.datePicker({createButton:false, startDate:'2009-05-03'})
|
||||
.bind('click', function() {
|
||||
$(this).dpDisplay();
|
||||
this.blur();
|
||||
return false;
|
||||
}
|
||||
);
|
||||
});
|
||||
</script>
|
||||
@@ -23,6 +23,7 @@
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/header.html.php';?>
|
||||
<?php include '../../common/datepicker.html.php';?>
|
||||
<div class='yui-d0'>
|
||||
<form method='post' target='hiddenwin'>
|
||||
<table class='table-1'>
|
||||
@@ -37,11 +38,11 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->productplan->begin;?></th>
|
||||
<td><input type='text' name='begin' class='text-3' /></td>
|
||||
<td><input type='text' name='begin' class='text-3 date' /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->productplan->end;?></th>
|
||||
<td><input type='text' name='end' class='text-3' /></td>
|
||||
<td><input type='text' name='end' class='text-3 date' /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->productplan->desc;?></th>
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/header.html.php';?>
|
||||
<?php include '../../common/datepicker.html.php';?>
|
||||
<div class='yui-d0'>
|
||||
<form method='post' target='hiddenwin'>
|
||||
<table class='table-1'>
|
||||
@@ -37,11 +38,11 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->productplan->begin;?></th>
|
||||
<td><?php echo html::input('begin', $plan->begin, 'class="text-3"');?></td>
|
||||
<td><?php echo html::input('begin', $plan->begin, 'class="text-3 date"');?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->productplan->end;?></th>
|
||||
<td><?php echo html::input('end', $plan->end, 'class="text-3"');?></td>
|
||||
<td><?php echo html::input('end', $plan->end, 'class="text-3 date"');?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->productplan->desc;?></th>
|
||||
|
||||
@@ -94,7 +94,7 @@ class project extends control
|
||||
$tasks = $this->loadModel('task')->getProjectTasks($projectID, $orderBy, $pager);
|
||||
|
||||
/* 赋值。*/
|
||||
$this->view->tasks = $tasks;
|
||||
$this->view->tasks = $tasks ? $tasks : array();
|
||||
$this->view->tabID = 'task';
|
||||
$this->view->pager = $pager->get();
|
||||
$this->view->recTotal = $pager->recTotal;
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/header.html.php';?>
|
||||
<?php include '../../common/datepicker.html.php';?>
|
||||
<div class='yui-d0'>
|
||||
<form method='post' target='hiddenwin'>
|
||||
<table align='center' class='table-1 a-left'>
|
||||
@@ -43,11 +44,11 @@
|
||||
-->
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->project->begin;?></th>
|
||||
<td><input type='text' name='begin' class='text-3' /></td>
|
||||
<td><input type='text' name='begin' class='text-3 date' /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->project->end;?></th>
|
||||
<td><input type='text' name='end' class='text-3' /></td>
|
||||
<td><input type='text' name='end' class='text-3 date' /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->project->teamname;?></th>
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/header.html.php';?>
|
||||
<?php include '../../common/datepicker.html.php';?>
|
||||
<div class='yui-d0'>
|
||||
<form method='post' target='hiddenwin'>
|
||||
<table align='center' class='table-1 a-left'>
|
||||
@@ -43,11 +44,11 @@
|
||||
-->
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->project->begin;?></th>
|
||||
<td><input type='text' name='begin' value='<?php echo $project->begin;?>' class='text-3' /></td>
|
||||
<td><input type='text' name='begin' value='<?php echo $project->begin;?>' class='text-3 date' /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->project->end;?></th>
|
||||
<td><input type='text' name='end' value='<?php echo $project->end;?>' class='text-3' /></td>
|
||||
<td><input type='text' name='end' value='<?php echo $project->end;?>' class='text-3 date' /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->project->teamname;?></th>
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/header.html.php';?>
|
||||
<?php include '../../common/datepicker.html.php';?>
|
||||
<div class='yui-d0'>
|
||||
<form method='post' target='hiddenwin'>
|
||||
<table class='table-1'>
|
||||
@@ -37,7 +38,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->release->date;?></th>
|
||||
<td><input type='text' name='date' class='text-3' value='<?php echo date('Y-m-d');?>' /></td>
|
||||
<td><input type='text' name='date' class='text-3 date' value='<?php echo date('Y-m-d');?>' /></td>
|
||||
</tr>
|
||||
</tr>
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/header.html.php';?>
|
||||
<?php include '../../common/datepicker.html.php';?>
|
||||
<div class='yui-d0'>
|
||||
<form method='post' target='hiddenwin'>
|
||||
<table class='table-1'>
|
||||
@@ -41,7 +42,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->release->date;?></th>
|
||||
<td><input type='text' name='date' class='text-3' value='<?php echo $release->date;?>' /></td>
|
||||
<td><input type='text' name='date' class='text-3 date' value='<?php echo $release->date;?>' /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->release->desc;?></th>
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
?>
|
||||
<?php include '../../common/header.html.php';?>
|
||||
<?php include '../../common/colorbox.html.php';?>
|
||||
<?php include '../../common/datepicker.html.php';?>
|
||||
<script language='javascript'>
|
||||
/* 拷贝需求标题为任务标题。*/
|
||||
function copyStoryTitle()
|
||||
@@ -85,11 +86,11 @@ $(document).ready(function()
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->task->estimate;?></th>
|
||||
<td><input type='text' name='estimate' class='text-3' /></td>
|
||||
<td><input type='text' name='estimate' id='estimate' class='text-3' /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->task->deadline;?></th>
|
||||
<td><input type='text' name='deadline' class='text-3' /></td>
|
||||
<td><input type='text' name='deadline' class='text-3 date' /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->task->type;?></th>
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/header.html.php';?>
|
||||
<?php include '../../common/datepicker.html.php';?>
|
||||
<form method='post' enctype='multipart/form-data' target='hiddenwin'>
|
||||
<div class='yui-d0'>
|
||||
<div id='titlebar'>
|
||||
@@ -85,7 +86,7 @@
|
||||
<table class='table-1'>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->task->deadline;?></th>
|
||||
<td><?php echo html::input('deadline', $task->deadline, "class='text-1'");?></td>
|
||||
<td><?php echo html::input('deadline', $task->deadline, "class='text-1 date'");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead w-p20'><?php echo $lang->task->estimate;?></th>
|
||||
|
||||
@@ -86,6 +86,7 @@ class testtaskModel extends model
|
||||
/* 关联用例。*/
|
||||
public function linkCase($taskID)
|
||||
{
|
||||
if($this->post->cases == false) return;
|
||||
foreach($this->post->cases as $key => $caseID)
|
||||
{
|
||||
$row->task = $taskID;
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/header.html.php';?>
|
||||
<?php include '../../common/datepicker.html.php';?>
|
||||
<div class='yui-d0'>
|
||||
<form method='post' target='hiddenwin'>
|
||||
<table class='table-1'>
|
||||
@@ -37,11 +38,11 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->testtask->begin;?></th>
|
||||
<td><?php echo html::input('begin', '', "class='text-3'");?>
|
||||
<td><?php echo html::input('begin', '', "class='text-3 date'");?>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->testtask->end;?></th>
|
||||
<td><?php echo html::input('end', '', "class='text-3'");?>
|
||||
<td><?php echo html::input('end', '', "class='text-3 date'");?>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->testtask->status;?></th>
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/header.html.php';?>
|
||||
<?php include '../../common/datepicker.html.php';?>
|
||||
<div class='yui-d0'>
|
||||
<form method='post' target='hiddenwin'>
|
||||
<table class='table-1'>
|
||||
@@ -37,11 +38,11 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->testtask->begin;?></th>
|
||||
<td><?php echo html::input('begin', $task->begin, "class='text-3'");?>
|
||||
<td><?php echo html::input('begin', $task->begin, "class='text-3 date'");?>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->testtask->end;?></th>
|
||||
<td><?php echo html::input('end', $task->end, "class='text-3'");?>
|
||||
<td><?php echo html::input('end', $task->end, "class='text-3 date'");?>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->testtask->status;?></th>
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/header.html.php';?>
|
||||
<?php include '../../common/datepicker.html.php';?>
|
||||
<div class='yui-d0'>
|
||||
<form method='post' target='hiddenwin'>
|
||||
<table align='center' class='table-5'>
|
||||
@@ -45,7 +46,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->user->join;?></th>
|
||||
<td><input type='text' name='join' /></td>
|
||||
<td><input type='text' name='join' class='date' /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->user->gendar;?></th>
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/header.html.php';?>
|
||||
<?php include '../../common/datepicker.html.php';?>
|
||||
<div class='yui-d0'>
|
||||
<form method='post' target='hiddenwin'>
|
||||
<table align='center' class='table-4 a-left'>
|
||||
@@ -45,7 +46,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->user->join;?></th>
|
||||
<td><input type='text' name='join' value='<?php echo $user->join;?>' /></td>
|
||||
<td><input type='text' name='join' value='<?php echo $user->join;?>' class='date' /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->user->gendar;?></th>
|
||||
|
||||
502
trunk/www/js/jquery/datepicker/date.js
vendored
Normal file
502
trunk/www/js/jquery/datepicker/date.js
vendored
Normal file
@@ -0,0 +1,502 @@
|
||||
/*
|
||||
* Date prototype extensions. Doesn't depend on any
|
||||
* other code. Doens't overwrite existing methods.
|
||||
*
|
||||
* Adds dayNames, abbrDayNames, monthNames and abbrMonthNames static properties and isLeapYear,
|
||||
* isWeekend, isWeekDay, getDaysInMonth, getDayName, getMonthName, getDayOfYear, getWeekOfYear,
|
||||
* setDayOfYear, addYears, addMonths, addDays, addHours, addMinutes, addSeconds methods
|
||||
*
|
||||
* Copyright (c) 2006 Jörn Zaefferer and Brandon Aaron (brandon.aaron@gmail.com || http://brandonaaron.net)
|
||||
*
|
||||
* Additional methods and properties added by Kelvin Luck: firstDayOfWeek, dateFormat, zeroTime, asString, fromString -
|
||||
* I've added my name to these methods so you know who to blame if they are broken!
|
||||
*
|
||||
* Dual licensed under the MIT and GPL licenses:
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
* http://www.gnu.org/licenses/gpl.html
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* An Array of day names starting with Sunday.
|
||||
*
|
||||
* @example dayNames[0]
|
||||
* @result 'Sunday'
|
||||
*
|
||||
* @name dayNames
|
||||
* @type Array
|
||||
* @cat Plugins/Methods/Date
|
||||
*/
|
||||
Date.dayNames = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
|
||||
|
||||
/**
|
||||
* An Array of abbreviated day names starting with Sun.
|
||||
*
|
||||
* @example abbrDayNames[0]
|
||||
* @result 'Sun'
|
||||
*
|
||||
* @name abbrDayNames
|
||||
* @type Array
|
||||
* @cat Plugins/Methods/Date
|
||||
*/
|
||||
Date.abbrDayNames = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
|
||||
|
||||
/**
|
||||
* An Array of month names starting with Janurary.
|
||||
*
|
||||
* @example monthNames[0]
|
||||
* @result 'January'
|
||||
*
|
||||
* @name monthNames
|
||||
* @type Array
|
||||
* @cat Plugins/Methods/Date
|
||||
*/
|
||||
Date.monthNames = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
|
||||
|
||||
/**
|
||||
* An Array of abbreviated month names starting with Jan.
|
||||
*
|
||||
* @example abbrMonthNames[0]
|
||||
* @result 'Jan'
|
||||
*
|
||||
* @name monthNames
|
||||
* @type Array
|
||||
* @cat Plugins/Methods/Date
|
||||
*/
|
||||
Date.abbrMonthNames = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
||||
|
||||
/**
|
||||
* The first day of the week for this locale.
|
||||
*
|
||||
* @name firstDayOfWeek
|
||||
* @type Number
|
||||
* @cat Plugins/Methods/Date
|
||||
* @author Kelvin Luck
|
||||
*/
|
||||
Date.firstDayOfWeek = 1;
|
||||
|
||||
/**
|
||||
* The format that string dates should be represented as (e.g. 'dd/mm/yyyy' for UK, 'mm/dd/yyyy' for US, 'yyyy-mm-dd' for Unicode etc).
|
||||
*
|
||||
* @name format
|
||||
* @type String
|
||||
* @cat Plugins/Methods/Date
|
||||
* @author Kelvin Luck
|
||||
*/
|
||||
Date.format = 'dd/mm/yyyy';
|
||||
//Date.format = 'mm/dd/yyyy';
|
||||
//Date.format = 'yyyy-mm-dd';
|
||||
//Date.format = 'dd mmm yy';
|
||||
|
||||
/**
|
||||
* The first two numbers in the century to be used when decoding a two digit year. Since a two digit year is ambiguous (and date.setYear
|
||||
* only works with numbers < 99 and so doesn't allow you to set years after 2000) we need to use this to disambiguate the two digit year codes.
|
||||
*
|
||||
* @name format
|
||||
* @type String
|
||||
* @cat Plugins/Methods/Date
|
||||
* @author Kelvin Luck
|
||||
*/
|
||||
Date.fullYearStart = '20';
|
||||
|
||||
(function() {
|
||||
|
||||
/**
|
||||
* Adds a given method under the given name
|
||||
* to the Date prototype if it doesn't
|
||||
* currently exist.
|
||||
*
|
||||
* @private
|
||||
*/
|
||||
function add(name, method) {
|
||||
if( !Date.prototype[name] ) {
|
||||
Date.prototype[name] = method;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Checks if the year is a leap year.
|
||||
*
|
||||
* @example var dtm = new Date("01/12/2008");
|
||||
* dtm.isLeapYear();
|
||||
* @result true
|
||||
*
|
||||
* @name isLeapYear
|
||||
* @type Boolean
|
||||
* @cat Plugins/Methods/Date
|
||||
*/
|
||||
add("isLeapYear", function() {
|
||||
var y = this.getFullYear();
|
||||
return (y%4==0 && y%100!=0) || y%400==0;
|
||||
});
|
||||
|
||||
/**
|
||||
* Checks if the day is a weekend day (Sat or Sun).
|
||||
*
|
||||
* @example var dtm = new Date("01/12/2008");
|
||||
* dtm.isWeekend();
|
||||
* @result false
|
||||
*
|
||||
* @name isWeekend
|
||||
* @type Boolean
|
||||
* @cat Plugins/Methods/Date
|
||||
*/
|
||||
add("isWeekend", function() {
|
||||
return this.getDay()==0 || this.getDay()==6;
|
||||
});
|
||||
|
||||
/**
|
||||
* Check if the day is a day of the week (Mon-Fri)
|
||||
*
|
||||
* @example var dtm = new Date("01/12/2008");
|
||||
* dtm.isWeekDay();
|
||||
* @result false
|
||||
*
|
||||
* @name isWeekDay
|
||||
* @type Boolean
|
||||
* @cat Plugins/Methods/Date
|
||||
*/
|
||||
add("isWeekDay", function() {
|
||||
return !this.isWeekend();
|
||||
});
|
||||
|
||||
/**
|
||||
* Gets the number of days in the month.
|
||||
*
|
||||
* @example var dtm = new Date("01/12/2008");
|
||||
* dtm.getDaysInMonth();
|
||||
* @result 31
|
||||
*
|
||||
* @name getDaysInMonth
|
||||
* @type Number
|
||||
* @cat Plugins/Methods/Date
|
||||
*/
|
||||
add("getDaysInMonth", function() {
|
||||
return [31,(this.isLeapYear() ? 29:28),31,30,31,30,31,31,30,31,30,31][this.getMonth()];
|
||||
});
|
||||
|
||||
/**
|
||||
* Gets the name of the day.
|
||||
*
|
||||
* @example var dtm = new Date("01/12/2008");
|
||||
* dtm.getDayName();
|
||||
* @result 'Saturday'
|
||||
*
|
||||
* @example var dtm = new Date("01/12/2008");
|
||||
* dtm.getDayName(true);
|
||||
* @result 'Sat'
|
||||
*
|
||||
* @param abbreviated Boolean When set to true the name will be abbreviated.
|
||||
* @name getDayName
|
||||
* @type String
|
||||
* @cat Plugins/Methods/Date
|
||||
*/
|
||||
add("getDayName", function(abbreviated) {
|
||||
return abbreviated ? Date.abbrDayNames[this.getDay()] : Date.dayNames[this.getDay()];
|
||||
});
|
||||
|
||||
/**
|
||||
* Gets the name of the month.
|
||||
*
|
||||
* @example var dtm = new Date("01/12/2008");
|
||||
* dtm.getMonthName();
|
||||
* @result 'Janurary'
|
||||
*
|
||||
* @example var dtm = new Date("01/12/2008");
|
||||
* dtm.getMonthName(true);
|
||||
* @result 'Jan'
|
||||
*
|
||||
* @param abbreviated Boolean When set to true the name will be abbreviated.
|
||||
* @name getDayName
|
||||
* @type String
|
||||
* @cat Plugins/Methods/Date
|
||||
*/
|
||||
add("getMonthName", function(abbreviated) {
|
||||
return abbreviated ? Date.abbrMonthNames[this.getMonth()] : Date.monthNames[this.getMonth()];
|
||||
});
|
||||
|
||||
/**
|
||||
* Get the number of the day of the year.
|
||||
*
|
||||
* @example var dtm = new Date("01/12/2008");
|
||||
* dtm.getDayOfYear();
|
||||
* @result 11
|
||||
*
|
||||
* @name getDayOfYear
|
||||
* @type Number
|
||||
* @cat Plugins/Methods/Date
|
||||
*/
|
||||
add("getDayOfYear", function() {
|
||||
var tmpdtm = new Date("1/1/" + this.getFullYear());
|
||||
return Math.floor((this.getTime() - tmpdtm.getTime()) / 86400000);
|
||||
});
|
||||
|
||||
/**
|
||||
* Get the number of the week of the year.
|
||||
*
|
||||
* @example var dtm = new Date("01/12/2008");
|
||||
* dtm.getWeekOfYear();
|
||||
* @result 2
|
||||
*
|
||||
* @name getWeekOfYear
|
||||
* @type Number
|
||||
* @cat Plugins/Methods/Date
|
||||
*/
|
||||
add("getWeekOfYear", function() {
|
||||
return Math.ceil(this.getDayOfYear() / 7);
|
||||
});
|
||||
|
||||
/**
|
||||
* Set the day of the year.
|
||||
*
|
||||
* @example var dtm = new Date("01/12/2008");
|
||||
* dtm.setDayOfYear(1);
|
||||
* dtm.toString();
|
||||
* @result 'Tue Jan 01 2008 00:00:00'
|
||||
*
|
||||
* @name setDayOfYear
|
||||
* @type Date
|
||||
* @cat Plugins/Methods/Date
|
||||
*/
|
||||
add("setDayOfYear", function(day) {
|
||||
this.setMonth(0);
|
||||
this.setDate(day);
|
||||
return this;
|
||||
});
|
||||
|
||||
/**
|
||||
* Add a number of years to the date object.
|
||||
*
|
||||
* @example var dtm = new Date("01/12/2008");
|
||||
* dtm.addYears(1);
|
||||
* dtm.toString();
|
||||
* @result 'Mon Jan 12 2009 00:00:00'
|
||||
*
|
||||
* @name addYears
|
||||
* @type Date
|
||||
* @cat Plugins/Methods/Date
|
||||
*/
|
||||
add("addYears", function(num) {
|
||||
this.setFullYear(this.getFullYear() + num);
|
||||
return this;
|
||||
});
|
||||
|
||||
/**
|
||||
* Add a number of months to the date object.
|
||||
*
|
||||
* @example var dtm = new Date("01/12/2008");
|
||||
* dtm.addMonths(1);
|
||||
* dtm.toString();
|
||||
* @result 'Tue Feb 12 2008 00:00:00'
|
||||
*
|
||||
* @name addMonths
|
||||
* @type Date
|
||||
* @cat Plugins/Methods/Date
|
||||
*/
|
||||
add("addMonths", function(num) {
|
||||
var tmpdtm = this.getDate();
|
||||
|
||||
this.setMonth(this.getMonth() + num);
|
||||
|
||||
if (tmpdtm > this.getDate())
|
||||
this.addDays(-this.getDate());
|
||||
|
||||
return this;
|
||||
});
|
||||
|
||||
/**
|
||||
* Add a number of days to the date object.
|
||||
*
|
||||
* @example var dtm = new Date("01/12/2008");
|
||||
* dtm.addDays(1);
|
||||
* dtm.toString();
|
||||
* @result 'Sun Jan 13 2008 00:00:00'
|
||||
*
|
||||
* @name addDays
|
||||
* @type Date
|
||||
* @cat Plugins/Methods/Date
|
||||
*/
|
||||
add("addDays", function(num) {
|
||||
//this.setDate(this.getDate() + num);
|
||||
this.setTime(this.getTime() + (num*86400000) );
|
||||
return this;
|
||||
});
|
||||
|
||||
/**
|
||||
* Add a number of hours to the date object.
|
||||
*
|
||||
* @example var dtm = new Date("01/12/2008");
|
||||
* dtm.addHours(24);
|
||||
* dtm.toString();
|
||||
* @result 'Sun Jan 13 2008 00:00:00'
|
||||
*
|
||||
* @name addHours
|
||||
* @type Date
|
||||
* @cat Plugins/Methods/Date
|
||||
*/
|
||||
add("addHours", function(num) {
|
||||
this.setHours(this.getHours() + num);
|
||||
return this;
|
||||
});
|
||||
|
||||
/**
|
||||
* Add a number of minutes to the date object.
|
||||
*
|
||||
* @example var dtm = new Date("01/12/2008");
|
||||
* dtm.addMinutes(60);
|
||||
* dtm.toString();
|
||||
* @result 'Sat Jan 12 2008 01:00:00'
|
||||
*
|
||||
* @name addMinutes
|
||||
* @type Date
|
||||
* @cat Plugins/Methods/Date
|
||||
*/
|
||||
add("addMinutes", function(num) {
|
||||
this.setMinutes(this.getMinutes() + num);
|
||||
return this;
|
||||
});
|
||||
|
||||
/**
|
||||
* Add a number of seconds to the date object.
|
||||
*
|
||||
* @example var dtm = new Date("01/12/2008");
|
||||
* dtm.addSeconds(60);
|
||||
* dtm.toString();
|
||||
* @result 'Sat Jan 12 2008 00:01:00'
|
||||
*
|
||||
* @name addSeconds
|
||||
* @type Date
|
||||
* @cat Plugins/Methods/Date
|
||||
*/
|
||||
add("addSeconds", function(num) {
|
||||
this.setSeconds(this.getSeconds() + num);
|
||||
return this;
|
||||
});
|
||||
|
||||
/**
|
||||
* Sets the time component of this Date to zero for cleaner, easier comparison of dates where time is not relevant.
|
||||
*
|
||||
* @example var dtm = new Date();
|
||||
* dtm.zeroTime();
|
||||
* dtm.toString();
|
||||
* @result 'Sat Jan 12 2008 00:01:00'
|
||||
*
|
||||
* @name zeroTime
|
||||
* @type Date
|
||||
* @cat Plugins/Methods/Date
|
||||
* @author Kelvin Luck
|
||||
*/
|
||||
add("zeroTime", function() {
|
||||
this.setMilliseconds(0);
|
||||
this.setSeconds(0);
|
||||
this.setMinutes(0);
|
||||
this.setHours(0);
|
||||
return this;
|
||||
});
|
||||
|
||||
/**
|
||||
* Returns a string representation of the date object according to Date.format.
|
||||
* (Date.toString may be used in other places so I purposefully didn't overwrite it)
|
||||
*
|
||||
* @example var dtm = new Date("01/12/2008");
|
||||
* dtm.asString();
|
||||
* @result '12/01/2008' // (where Date.format == 'dd/mm/yyyy'
|
||||
*
|
||||
* @name asString
|
||||
* @type Date
|
||||
* @cat Plugins/Methods/Date
|
||||
* @author Kelvin Luck
|
||||
*/
|
||||
add("asString", function(format) {
|
||||
var r = format || Date.format;
|
||||
return r
|
||||
.split('yyyy').join(this.getFullYear())
|
||||
.split('yy').join((this.getFullYear() + '').substring(2))
|
||||
.split('mmmm').join(this.getMonthName(false))
|
||||
.split('mmm').join(this.getMonthName(true))
|
||||
.split('mm').join(_zeroPad(this.getMonth()+1))
|
||||
.split('dd').join(_zeroPad(this.getDate()))
|
||||
.split('hh').join(_zeroPad(this.getHours()))
|
||||
.split('min').join(_zeroPad(this.getMinutes()))
|
||||
.split('ss').join(_zeroPad(this.getSeconds()));
|
||||
});
|
||||
|
||||
/**
|
||||
* Returns a new date object created from the passed String according to Date.format or false if the attempt to do this results in an invalid date object
|
||||
* (We can't simple use Date.parse as it's not aware of locale and I chose not to overwrite it incase it's functionality is being relied on elsewhere)
|
||||
*
|
||||
* @example var dtm = Date.fromString("12/01/2008");
|
||||
* dtm.toString();
|
||||
* @result 'Sat Jan 12 2008 00:00:00' // (where Date.format == 'dd/mm/yyyy'
|
||||
*
|
||||
* @name fromString
|
||||
* @type Date
|
||||
* @cat Plugins/Methods/Date
|
||||
* @author Kelvin Luck
|
||||
*/
|
||||
Date.fromString = function(s, format)
|
||||
{
|
||||
var f = format || Date.format;
|
||||
var d = new Date('01/01/1977');
|
||||
|
||||
var mLength = 0;
|
||||
|
||||
var iM = f.indexOf('mmmm');
|
||||
if (iM > -1) {
|
||||
for (var i=0; i<Date.monthNames.length; i++) {
|
||||
var mStr = s.substr(iM, Date.monthNames[i].length);
|
||||
if (Date.monthNames[i] == mStr) {
|
||||
mLength = Date.monthNames[i].length - 4;
|
||||
break;
|
||||
}
|
||||
}
|
||||
d.setMonth(i);
|
||||
} else {
|
||||
iM = f.indexOf('mmm');
|
||||
if (iM > -1) {
|
||||
var mStr = s.substr(iM, 3);
|
||||
for (var i=0; i<Date.abbrMonthNames.length; i++) {
|
||||
if (Date.abbrMonthNames[i] == mStr) break;
|
||||
}
|
||||
d.setMonth(i);
|
||||
} else {
|
||||
d.setMonth(Number(s.substr(f.indexOf('mm'), 2)) - 1);
|
||||
}
|
||||
}
|
||||
|
||||
var iY = f.indexOf('yyyy');
|
||||
|
||||
if (iY > -1) {
|
||||
if (iM < iY)
|
||||
{
|
||||
iY += mLength;
|
||||
}
|
||||
d.setFullYear(Number(s.substr(iY, 4)));
|
||||
} else {
|
||||
if (iM < iY)
|
||||
{
|
||||
iY += mLength;
|
||||
}
|
||||
// TODO - this doesn't work very well - are there any rules for what is meant by a two digit year?
|
||||
d.setFullYear(Number(Date.fullYearStart + s.substr(f.indexOf('yy'), 2)));
|
||||
}
|
||||
var iD = f.indexOf('dd');
|
||||
if (iM < iD)
|
||||
{
|
||||
iD += mLength;
|
||||
}
|
||||
d.setDate(Number(s.substr(iD, 2)));
|
||||
if (isNaN(d.getTime())) {
|
||||
return false;
|
||||
}
|
||||
return d;
|
||||
};
|
||||
|
||||
// utility method
|
||||
var _zeroPad = function(num) {
|
||||
var s = '0'+num;
|
||||
return s.substring(s.length-2)
|
||||
//return ('0'+num).substring(-2); // doesn't work on IE :(
|
||||
};
|
||||
|
||||
})();
|
||||
1
trunk/www/js/jquery/datepicker/min.js
vendored
Normal file
1
trunk/www/js/jquery/datepicker/min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
127
trunk/www/theme/default/datepicker.css
Normal file
127
trunk/www/theme/default/datepicker.css
Normal file
@@ -0,0 +1,127 @@
|
||||
table.jCalendar {
|
||||
border: 1px solid #000;
|
||||
background: #aaa;
|
||||
border-collapse: separate;
|
||||
border-spacing: 2px;
|
||||
}
|
||||
table.jCalendar th {
|
||||
background: #333;
|
||||
color: #fff;
|
||||
font-weight: bold;
|
||||
padding: 3px 5px;
|
||||
}
|
||||
|
||||
table.jCalendar td {
|
||||
background: #ccc;
|
||||
color: #000;
|
||||
padding: 3px 5px;
|
||||
text-align: center;
|
||||
}
|
||||
table.jCalendar td.other-month {
|
||||
background: #ddd;
|
||||
color: #aaa;
|
||||
}
|
||||
table.jCalendar td.today {
|
||||
background: #666;
|
||||
color: #fff;
|
||||
}
|
||||
table.jCalendar td.selected {
|
||||
background: #f66;
|
||||
color: #fff;
|
||||
}
|
||||
table.jCalendar td.selected.dp-hover {
|
||||
background: #f33;
|
||||
color: #fff;
|
||||
}
|
||||
table.jCalendar td.dp-hover,
|
||||
table.jCalendar tr.activeWeekHover td {
|
||||
background: #fff;
|
||||
color: #000;
|
||||
}
|
||||
table.jCalendar tr.selectedWeek td {
|
||||
background: #f66;
|
||||
color: #fff;
|
||||
}
|
||||
table.jCalendar td.disabled, table.jCalendar td.disabled.dp-hover {
|
||||
background: #bbb;
|
||||
color: #888;
|
||||
}
|
||||
table.jCalendar td.unselectable,
|
||||
table.jCalendar td.unselectable:hover,
|
||||
table.jCalendar td.unselectable.dp-hover {
|
||||
background: #bbb;
|
||||
color: #888;
|
||||
}
|
||||
|
||||
/* For the popup */
|
||||
|
||||
/* NOTE - you will probably want to style a.dp-choose-date - see how I did it in demo.css */
|
||||
|
||||
div.dp-popup {
|
||||
position: relative;
|
||||
background: #ccc;
|
||||
font-size: 10px;
|
||||
font-family: arial, sans-serif;
|
||||
padding: 2px;
|
||||
width: 185px;
|
||||
line-height: 1.2em;
|
||||
}
|
||||
div#dp-popup {
|
||||
position: absolute;
|
||||
z-index: 199;
|
||||
}
|
||||
div.dp-popup h2 {
|
||||
font-size: 12px;
|
||||
text-align: center;
|
||||
margin: 2px 0;
|
||||
padding: 0;
|
||||
}
|
||||
a#dp-close {
|
||||
font-size: 11px;
|
||||
padding: 4px 0;
|
||||
text-align: center;
|
||||
display: block;
|
||||
}
|
||||
a#dp-close:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
div.dp-popup a {
|
||||
color: #000;
|
||||
text-decoration: none;
|
||||
padding: 3px 2px 0;
|
||||
}
|
||||
div.dp-popup div.dp-nav-prev {
|
||||
position: absolute;
|
||||
top: 2px;
|
||||
left: 4px;
|
||||
width: 100px;
|
||||
}
|
||||
div.dp-popup div.dp-nav-prev a {
|
||||
float: left;
|
||||
}
|
||||
/* Opera needs the rules to be this specific otherwise it doesn't change the cursor back to pointer after you have disabled and re-enabled a link */
|
||||
div.dp-popup div.dp-nav-prev a, div.dp-popup div.dp-nav-next a {
|
||||
cursor: pointer;
|
||||
}
|
||||
div.dp-popup div.dp-nav-prev a.disabled, div.dp-popup div.dp-nav-next a.disabled {
|
||||
cursor: default;
|
||||
}
|
||||
div.dp-popup div.dp-nav-next {
|
||||
position: absolute;
|
||||
top: 2px;
|
||||
right: 4px;
|
||||
width: 100px;
|
||||
}
|
||||
div.dp-popup div.dp-nav-next a {
|
||||
float: right;
|
||||
}
|
||||
div.dp-popup a.disabled {
|
||||
cursor: default;
|
||||
color: #aaa;
|
||||
}
|
||||
div.dp-popup td {
|
||||
cursor: pointer;
|
||||
}
|
||||
div.dp-popup td.disabled {
|
||||
cursor: default;
|
||||
}
|
||||
BIN
trunk/www/theme/default/images/datepicker/calendar.png
Normal file
BIN
trunk/www/theme/default/images/datepicker/calendar.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
Reference in New Issue
Block a user