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.