blob: 6d78a664828c1b9eafe10d4a9ec8c74f5cb439c9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
<?php
prado::using('System.Web.UI.ActiveControls.*');
class ActiveDatePicker extends TPage {
public function onLoad($param){
parent::onLoad($param);
if(!$this->IsPostBack)
$this->datepicker->setTimeStamp(time());
}
public function testDatePicker($sender, $param){
$this->status->Text = $this->datepicker->getText();
}
public function today ($sender, $param)
{
$this->datepicker->setTimestamp(time());
}
public function increase ($sender, $param)
{
$this->datepicker->setTimestamp(strtotime('+1 day', $this->datepicker->getTimestamp()));
}
public function decrease ($sender, $param)
{
$this->datepicker->setTimestamp(strtotime('-1 day', $this->datepicker->getTimestamp()));
}
public function toggleMode ($sender, $param)
{
if ($this->datepicker->getInputMode()==TDatePickerInputMode::DropDownList)
$this->datepicker->setInputMode(TDatePickerInputMode::TextBox);
else
$this->datepicker->setInputMode(TDatePickerInputMode::DropDownList);
}
}
?>
|