priority
Standard
status
New Issue

qcodo
0.4.17 (Development)
category
General Framework
php
5.3.0



Votes
There are no votes for this issue.
Example Code

$this->dtxCalendar=new QDateTimeTextBox($this);
$this->calCalendar=new QCalendar($this, $this->dtxCalendar);
$this->dtxCalendar->AddAction(new QFocusEvent(), new QBlurControlAction($this->dtxCalendar));
$this->dtxCalendar->AddAction(new QClickEvent(), new QShowCalendarAction($this->calCalendar));
Example Template

<p>
<?php $this->dtxCalendar->Render(); ?>
<?php $this
->calCalendar->Render(); ?>
</p>
Expected Output
2010-10-09
Actual Output
2010-10-08

reported: tuesday, august 31, 2010, 10:46 am pdt  |  by: apselico  |  messages: 3 messages  |  last: about 8 years ago


#1  |  apselico (Trujillo, PE) Peru
Tuesday, August 31, 2010, 10:46 AM PDT

I im using the folowing autoincludes:
QApplication::InitializeI18n();
QDateTime::$Translate = true;

in my configuration.inc.php :
date_default_timezone_set('America/Lima');

and in QApplication class:
QApplication::$CountryCode = 'es';
QApplication::$LanguageCode = 'es';
QI18n::Initialize();

When i select a date like 2010-10-09 and i try to change date then the calendar shows 2010-10-08, the bug is located in calendar.js file.

#2  |  ‹‹ Qcodo System Message ››
Tuesday, August 31, 2010, 11:27 AM PDT

apselico made content edits to the issue

#3  |  apselico (Trujillo, PE) Peru
Tuesday, August 31, 2010, 11:34 AM PDT

this is the way how i fix it:

objControl.setDate = function(intYear, intMonth, intDay) {
        if (qcodo.dateTimeTranslated) {
            intMonth++;
            if (intMonth < 10) {
                intMonth = "0" + intMonth;
            }
                if (intDay < 10) {
                    intDay = "0"+intDay;
                }
        this.dateTimeTextBox.value = intYear + "-" + intMonth + "-" + intDay;
    } else
        this.dateTimeTextBox.value = qcodo.monthNamesAbbreviated[intMonth] + " " + intDay + " " + intYear;
        this.hideCalendar();
    };


objControl.drawCalendar = function(intYear, intMonth) {
    // Get the "selected" date and the "current" date
    var dttSelected;
    if (this.dateTimeTextBox.value){
               if (qcodo.dateTimeTranslated) {
                    var strDateSelected = this.dateTimeTextBox.value;

                    dttSelected = new Date();
                    dttSelected.setFullYear(strDateSelected.substr(0,4),(new Number(strDateSelected.substr(5,2)))-1,strDateSelected.substr(8,2));
                }else{
                    dttSelected = new Date(this.dateTimeTextBox.value);
                }
            }
    var dttToday = new Date();
...
.bc


Copyright © 2005 - 2019, Quasidea Development, LLC
This open-source framework for PHP is released under the terms of The MIT License.