[Development] Calendar Systems proposal

Hamed Masafi hamed.masafi at gmail.com
Mon Jan 30 08:59:12 CET 2017


I'm working on qml support of calendar system,
for porting this mechanism to qml we have two option:

1)
Add a global object to jsengine?
Somthing like that :

var date = new Date;
var cal = new JalaliCalendar;
var out = date.toString(cal, "yyyy-MM-dd");

In this case JalaliCalendar is a new global object type (like date, string,
regex, array and etc).

2)
Or another option may be adding calendar() to global Qt function, the usage
example can be like that:

var date = new Date;
var out = date.toString(Qt.calendar('jalali'), "yyyy-MM-dd");

‚Äč3)

var date = new Date;
var out = date.toString(Qt.JalaliCalendar, "yyyy-MM-dd");

In this method Qt.calendar like Qt.locale initialize with a string.

Now question is that: witch form is preferred? Will be case (1) break Qt
rules?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20170130/1913b4c3/attachment.html>


More information about the Development mailing list