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.

Parents
  • Thanks for the insights Alan.raceQs

    I have now tested my data field using the Gregorian.localMoment(where, when.value()) function call. It's called three times every second in my App. After some time of running, I think 5-10 min, it crashed in the very line with a call to this function! And, it crashed with 

         Error: Out Of Memory Error
         Details: 'Failed invoking <symbol>'    

    So, something in this function implementation on my Epix2 seem to leak memory or whatever. Clearly this function cannot be trusted in practice!!!!  

Comment
  • Thanks for the insights Alan.raceQs

    I have now tested my data field using the Gregorian.localMoment(where, when.value()) function call. It's called three times every second in my App. After some time of running, I think 5-10 min, it crashed in the very line with a call to this function! And, it crashed with 

         Error: Out Of Memory Error
         Details: 'Failed invoking <symbol>'    

    So, something in this function implementation on my Epix2 seem to leak memory or whatever. Clearly this function cannot be trusted in practice!!!!  

Children
No Data