diff options
Diffstat (limited to 'src/qml/qml')
-rw-r--r-- | src/qml/qml/qqmllocale.cpp | 18 | ||||
-rw-r--r-- | src/qml/qml/qqmllocale_p.h | 1 |
2 files changed, 19 insertions, 0 deletions
diff --git a/src/qml/qml/qqmllocale.cpp b/src/qml/qml/qqmllocale.cpp index 7d2dafe3b3..9a2ec6f0e3 100644 --- a/src/qml/qml/qqmllocale.cpp +++ b/src/qml/qml/qqmllocale.cpp @@ -131,6 +131,13 @@ static const char *dateFromLocaleDateStringFunction = " })" "})"; +static const char *dateTimeZoneUpdatedFunction = + "(function(timeZoneUpdatedFunc) { " + " Date.timeZoneUpdated = (function() {" + " return timeZoneUpdatedFunc.apply(null, arguments);" + " })" + "})"; + static void registerFunction(QV8Engine *engine, const char *script, v8::InvocationCallback func) { @@ -150,6 +157,7 @@ void QQmlDateExtension::registerExtension(QV8Engine *engine) registerFunction(engine, dateFromLocaleStringFunction, fromLocaleString); registerFunction(engine, dateFromLocaleTimeStringFunction, fromLocaleTimeString); registerFunction(engine, dateFromLocaleDateStringFunction, fromLocaleDateString); + registerFunction(engine, dateTimeZoneUpdatedFunction, timeZoneUpdated); } v8::Handle<v8::Value> QQmlDateExtension::toLocaleString(const v8::Arguments& args) @@ -387,6 +395,16 @@ v8::Handle<v8::Value> QQmlDateExtension::fromLocaleDateString(const v8::Argument return QJSConverter::toDateTime(QDateTime(dt)); } +v8::Handle<v8::Value> QQmlDateExtension::timeZoneUpdated(const v8::Arguments& args) +{ + if (args.Length() != 0) + V8THROW_ERROR("Locale: Date.timeZoneUpdated(): Invalid arguments"); + + v8::Date::DateTimeConfigurationChangeNotification(); + + return v8::Undefined(); +} + //----------------- // Number extension diff --git a/src/qml/qml/qqmllocale_p.h b/src/qml/qml/qqmllocale_p.h index c701c1ca1c..7007770245 100644 --- a/src/qml/qml/qqmllocale_p.h +++ b/src/qml/qml/qqmllocale_p.h @@ -66,6 +66,7 @@ private: static v8::Handle<v8::Value> fromLocaleString(const v8::Arguments& args); static v8::Handle<v8::Value> fromLocaleTimeString(const v8::Arguments& args); static v8::Handle<v8::Value> fromLocaleDateString(const v8::Arguments& args); + static v8::Handle<v8::Value> timeZoneUpdated(const v8::Arguments& args); }; |