summaryrefslogtreecommitdiff
path: root/tests/FunctionalTests/active-controls/protected/pages/ActiveDatePicker.php
blob: 9baa2a0ad5ca16a6514232527fe756ccbc5ab3ad (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
43
44
45
46
47
48
<?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 testDatePicker2($sender, $param){
		$this->status2->Text = $this->datepicker2->getText();
	}

	public function testDatePicker3($sender, $param){
		$this->status3->Text = $this->datepicker3->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);
	}
	
 }