summaryrefslogtreecommitdiffstats
path: root/comm/calendar/test/unit/test_bug272411.js
blob: c871b53cf0f05def57739f3a4a8b3aad1ef52aad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

function run_test() {
  let jsd = new Date();
  let cdt = cal.dtz.jsDateToDateTime(jsd);

  let cdtTime = cal.dtz.dateTimeToJsDate(cdt).getTime() / 1000;
  let jsdTime = Math.floor(jsd.getTime() / 1000);

  // calIDateTime is only accurate to the second, milliseconds need to be
  // stripped.
  equal(cdtTime, jsdTime);
}