Ticket Created
over 3 years ago

WERETECH-12628

LocalMoment is wrong

The documentation fails to provide an initializing Constructor and the example is wrong.

a) It requires (where, when) not (when, where).

b) it doesn't take a Gregorian.moment as the when argument.

This, from the documentation fails:

if (Gregorian has :localMoment){
		var options = {
			:year   => 2018,
			:month  => 2,
			:day    => 24,
			:hour   => 0,
			:min    => 12 
		};
		var when = Gregorian.moment(options);
		
		var where = new Position.Location({
			:latitude  =>  38.85391,
			:longitude => -94.79630,
			:format    => :degrees,
		});

		var local = Gregorian.localMoment(when, where);
		var info = Gregorian.info(local, Time.FORMAT_SHORT);
	}

This works

if (Gregorian has :localMoment){
		var options = {
			:year   => 2018,
			:month  => 2,
			:day    => 24,
			:hour   => 0,
			:min    => 12 
		};
		var when = Gregorian.moment(options);
		
		var where = new Position.Location({
			:latitude  =>  38.85391,
			:longitude => -94.79630,
			:format    => :degrees,
		});

		var local = Gregorian.localMoment(where, when.value());
		var info = Gregorian.info(local, Time.FORMAT_SHORT);
	}

- note (where, when), not (when, where) , and a number not a moment.

  • No I don't. I only have it in my Debug version which I only run in the Simulator, sorry I can't help.

  • The latest documentation now correctly state Gregorian.localMoment(where, when)) - so the where, when order is correct.

    But it does not state to use  Gregorian.localMoment(where, when.value())

    In the simulator Gregorian.localMoment(where, when) works just fine - but when I load it to my Epix device, it causes a crash.

    If I change to my code to Gregorian.localMoment(where, when.value()) - my code still seem to work just fine in simulator - AND now also work on my Epix device... huh?

    I get really nervous here. If I implement Gregorian.localMoment(where, when.value()) can I rely on this to work also in future firmware releases/devices? Does it work for all devices and not just Epix? What is the longer term plan here?

    Alan.raceQs: Have you Apps using this in the field?