RE: [Alarm] respectTimezone

Hi Marcos,

I fully support this proposal. If we make the respectTimezone argument optional, then it makes a lot of sense to use a dictionary for respectTimezone and the custom data since they would both be optional. Then, we can use a boolean for respectTimezone indeed.

I also think that respectTimezone should be set to True by default.

Anyone has any objection to this change?

Kr,
Christophe Dumez.
________________________________________
From: Marcos Caceres [marcosscaceres@gmail.com]
Sent: Tuesday, February 12, 2013 00:05
To: public-sysapps@w3.org
Subject: [Alarm] respectTimezone

The spec says:
> > The second argument respectTimezone can be either "respectTimezone" or "ignoreTimezone" to

This seems to be a boolean in disguise:) Also, why is this a required argument? In most cases, you want to "respectTimezone", right?


I can see the logic of having it as a string instead of a boolean (legibility), but if you are going to keep it as a string camelCasing seems annoying. Maybe we can find a way of shortening it or use a dictionary to avoid the following case if it's made optional:

var time = new Date("June 29, 2012 07:30:00");
//this would be kinda sucky…
navigator.alarms.add(time, undefined, { mydata: "foo" });

If an optional dictionary was used, then it can become:

var mydata = {foo: "fum"};
navigator.alarms.add(time, {respectTimezone: false , data: mydata});

//or, respectTimezone is always true, so we just omit it
navigator.alarms.add(time, {data: mydata});


And that would be nicer in that respectTimezone is now and actual boolean (instead of a string masquerading as a boolean), and it's clear what it is when the code is read. And it avoids the "undefined" hole for an optional value. It also allows the API to be extended in the future if need be by simply adding new items to the dictionary.

If you like the proposal, please chance/add:

interface AlarmManager : EventTarget {
  AlarmRequest add(Date date, optional AlarmInit);
  ...
};


dictionary AlarmInit {
  boolean respectTimezone = true;
  object data;
};



--
Marcos Caceres
http://datadriven.com.au




Received on Tuesday, 12 February 2013 07:31:58 UTC