Skip to content

Commit

Permalink
Fixed JSON Object Dump
Browse files Browse the repository at this point in the history
As per issue e-mission#994, fixed the `Download JSON Dump`.  The previous
date-picker formatted the  input as 'dd MMM yyyy', used luxon to
format the object.

This is a bit hacky - going to rewrite the 'ControlHelper' service,
and completely remove the `moment()` altogether.
  • Loading branch information
the-bay-kay committed Oct 4, 2023
1 parent 77fe30a commit 4f84643
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions www/js/services.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import angular from 'angular';
import { getRawEntries } from './commHelper';
import { DateTime } from 'luxon';

angular.module('emission.services', ['emission.plugin.logger'])

Expand Down Expand Up @@ -114,8 +115,9 @@ angular.module('emission.services', ['emission.plugin.logger'])
var fmt = "YYYY-MM-DD";
// We are only retrieving data for a single day to avoid
// running out of memory on the phone
var startMoment = moment(startTs);
var endMoment = moment(startTs).endOf("day");
var adjustedTs = DateTime.fromJSDate(startTs).toFormat('dd MMM yyyy');
var startMoment = moment(adjustedTs);
var endMoment = moment(adjustedTs).endOf("day");
var dumpFile = startMoment.format(fmt) + "."
+ endMoment.format(fmt)
+ ".timeline";
Expand Down

0 comments on commit 4f84643

Please sign in to comment.