<commit_before>var moment = require("../index");

exports["manipulate"] = {
  "add" : function (t) {    
    t.equal(
      moment('2012-10-28 00:00:00 +01:00').tz('Europe/London').add('days', 1).format(),
      '2012-10-29T00:00:00+00:00',
      "adding 1 day while crossing a DST boundary should not affect time (BST -> GMT).");
    t.equal(
      moment('2013-11-03T00:00:00-07:00').tz('America/Los_Angeles').add(1, 'day').format(),
      "2013-11-04T00:00:00-08:00",
      "adding 1 day while crossing a DST boundary should not affect time (PDT-> PST).");    
    t.equal(
      moment("2014-03-09T00:00:00-08:00").tz('America/Los_Angeles').add(1, 'day').format(),
      "2014-03-10T00:00:00-07:00",
      "adding 1 day while crossing a DST boundary should not affect time (PST -> PDT).");
    t.done();
  },
  "subtract" : function (t) {
    t.equal(
      moment('2012-10-29 00:00:00 +00:00').tz('Europe/London').subtract('days', 1).format(),
      '2012-10-28T00:00:00+01:00',
      "subtracting 1 day while crossing a DST boundary should not affect time (GMT -> BST).");
    t.equal(
      moment("2013-11-04T00:00:00-08:00").tz('America/Los_Angeles').subtract(1, 'day').format(),
      '2013-11-03T00:00:00-07:00',
      "adding 1 day while crossing a DST boundary should not affect time (PST -> PDT).");    
    t.equal(
      moment("2014-03-10T00:00:00-07:00").tz('America/Los_Angeles').subtract(1, 'day').format(),
      "2014-03-09T00:00:00-08:00",
      "adding 1 day while crossing a DST boundary should not affect time (PDT -> PST).");
    t.done();
  },
  "month" : function (t) {
    t.equal(
      moment("2014-03-09T00:00:00-08:00").tz('America/Los_Angeles').add(1, 'month').format(),
      "2014-04-09T00:00:00-07:00",
      "adding 1 month while crossing a DST boundary should not affect time (PST -> PDT).");
    t.equal(
      moment("2014-03-09T00:00:00-08:00").tz('America/Los_Angeles').month("April").format(),
      "2014-04-09T00:00:00-07:00",
      "setting month across a DST boundary should not affect time (PST -> PDT).");
    
    t.done();
  }
  
};<commit_msg>Use ISO format when creating test moments<commit_after>var moment = require("../index");

exports["manipulate"] = {
  "add" : function (t) {
    t.equal(
      moment('2012-10-28 00:00:00+01:00').tz('Europe/London').add('days', 1).format(),
      '2012-10-29T00:00:00+00:00',
      "adding 1 day while crossing a DST boundary should not affect time (BST -> GMT).");
    t.equal(
      moment('2013-11-03T00:00:00-07:00').tz('America/Los_Angeles').add(1, 'day').format(),
      "2013-11-04T00:00:00-08:00",
      "adding 1 day while crossing a DST boundary should not affect time (PDT-> PST).");
    t.equal(
      moment("2014-03-09T00:00:00-08:00").tz('America/Los_Angeles').add(1, 'day').format(),
      "2014-03-10T00:00:00-07:00",
      "adding 1 day while crossing a DST boundary should not affect time (PST -> PDT).");
    t.done();
  },
  "subtract" : function (t) {
    t.equal(
      moment('2012-10-29T00:00:00+00:00').tz('Europe/London').subtract('days', 1).format(),
      '2012-10-28T00:00:00+01:00',
      "subtracting 1 day while crossing a DST boundary should not affect time (GMT -> BST).");
    t.equal(
      moment("2013-11-04T00:00:00-08:00").tz('America/Los_Angeles').subtract(1, 'day').format(),
      '2013-11-03T00:00:00-07:00',
      "adding 1 day while crossing a DST boundary should not affect time (PST -> PDT).");
    t.equal(
      moment("2014-03-10T00:00:00-07:00").tz('America/Los_Angeles').subtract(1, 'day').format(),
      "2014-03-09T00:00:00-08:00",
      "adding 1 day while crossing a DST boundary should not affect time (PDT -> PST).");
    t.done();
  },
  "month" : function (t) {
    t.equal(
      moment("2014-03-09T00:00:00-08:00").tz('America/Los_Angeles').add(1, 'month').format(),
      "2014-04-09T00:00:00-07:00",
      "adding 1 month while crossing a DST boundary should not affect time (PST -> PDT).");
    t.equal(
      moment("2014-03-09T00:00:00-08:00").tz('America/Los_Angeles').month("April").format(),
      "2014-04-09T00:00:00-07:00",
      "setting month across a DST boundary should not affect time (PST -> PDT).");

    t.done();
  }

};
{'fraction_non_alphanumeric': 0.2008567348881485, 'fraction_numerical': 0.14374107567824845, 'mean_word_length': 3.203, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7419506', 'n_tokens_mistral': 1910, 'n_tokens_neox': 1551, 'n_words': 325}