summaryrefslogtreecommitdiffstats
path: root/src/script/api/qscriptengine_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/script/api/qscriptengine_p.h')
-rw-r--r--src/script/api/qscriptengine_p.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/script/api/qscriptengine_p.h b/src/script/api/qscriptengine_p.h
index 1b35704..c71465d 100644
--- a/src/script/api/qscriptengine_p.h
+++ b/src/script/api/qscriptengine_p.h
@@ -50,7 +50,6 @@
#include "bridge/qscriptobject_p.h"
#include "bridge/qscriptqobject_p.h"
#include "bridge/qscriptvariant_p.h"
-#include "utils/qscriptdate_p.h"
#include "DateConstructor.h"
#include "DateInstance.h"
@@ -119,6 +118,9 @@ namespace QScript
inline QString ToString(qsreal);
#endif
+ QDateTime MsToDateTime(JSC::ExecState *, qsreal);
+ qsreal DateTimeToMs(JSC::ExecState *, const QDateTime &);
+
//some conversion helper functions
inline QScriptEnginePrivate *scriptEngineFromExec(const JSC::ExecState *exec);
bool isFunction(JSC::JSValue value);
@@ -861,7 +863,7 @@ inline JSC::JSValue QScriptEnginePrivate::newDate(JSC::ExecState *exec, qsreal v
inline JSC::JSValue QScriptEnginePrivate::newDate(JSC::ExecState *exec, const QDateTime &value)
{
- return newDate(exec, QScript::FromDateTime(value));
+ return newDate(exec, QScript::DateTimeToMs(exec, value));
}
inline JSC::JSValue QScriptEnginePrivate::newObject()
@@ -994,12 +996,12 @@ inline JSC::UString QScriptEnginePrivate::toString(JSC::ExecState *exec, JSC::JS
return str;
}
-inline QDateTime QScriptEnginePrivate::toDateTime(JSC::ExecState *, JSC::JSValue value)
+inline QDateTime QScriptEnginePrivate::toDateTime(JSC::ExecState *exec, JSC::JSValue value)
{
if (!isDate(value))
return QDateTime();
qsreal t = static_cast<JSC::DateInstance*>(JSC::asObject(value))->internalNumber();
- return QScript::ToDateTime(t, Qt::LocalTime);
+ return QScript::MsToDateTime(exec, t);
}
inline QObject *QScriptEnginePrivate::toQObject(JSC::ExecState *exec, JSC::JSValue value)