diff options
author | Lars Knoll <lars.knoll@theqtcompany.com> | 2015-03-02 21:40:43 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@theqtcompany.com> | 2015-04-24 15:20:59 +0000 |
commit | 353b4e6ffdea7d59687c67da7082834cfd55aaf7 (patch) | |
tree | 5b180668d06230a44a2e90a68ad752b7e4e5bba1 /src/qml/jsruntime/qv4dateobject_p.h | |
parent | 68d74b67da1c14045e04ff13d7cd1bce8ea8d622 (diff) |
Store the datetime as a double in the date object
Change-Id: I6ae05a066d021e81eaed90866e09bf480f5d91d9
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'src/qml/jsruntime/qv4dateobject_p.h')
-rw-r--r-- | src/qml/jsruntime/qv4dateobject_p.h | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/qml/jsruntime/qv4dateobject_p.h b/src/qml/jsruntime/qv4dateobject_p.h index a4c508a628..47029097a9 100644 --- a/src/qml/jsruntime/qv4dateobject_p.h +++ b/src/qml/jsruntime/qv4dateobject_p.h @@ -49,16 +49,16 @@ struct DateObject : Object { DateObject(InternalClass *ic, QV4::Object *prototype) : Object(ic, prototype) { - value = Encode(qSNaN()); + date = qSNaN(); } DateObject(QV4::ExecutionEngine *engine, const Value &date) : Object(engine->emptyClass, engine->datePrototype.objectValue()) { - value = date; + this->date = date.toNumber(); } DateObject(QV4::ExecutionEngine *engine, const QDateTime &date); - Value value; + double date; }; @@ -73,9 +73,8 @@ struct DateObject: Object { Q_MANAGED_TYPE(DateObject) - Value date() const { return d()->value; } - Value &date() { return d()->value; } - void setDate(const Value &date) { d()->value = date; } + double date() const { return d()->date; } + void setDate(double date) { d()->date = date; } QDateTime toQDateTime() const; }; |