How to use the ember-cli-mirage.faker.date function in ember-cli-mirage

To help you get started, we’ve selected a few ember-cli-mirage examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github CenterForOpenScience / ember-osf-web / mirage / factories / comment.ts View on Github external
dateModified() {
        return faker.date.past(3);
    },
    modified: false,
github hashicorp / levant / vendor / github.com / hashicorp / nomad / ui / mirage / factories / node.js View on Github external
const generate = name => {
    const detected = Math.random() > 0.3;
    const healthy = detected && Math.random() > 0.3;
    const attributes = {
      [`driver.${name}.version`]: '1.0.0',
      [`driver.${name}.status`]: 'awesome',
      [`driver.${name}.more.details`]: 'yeah',
      [`driver.${name}.more.again`]: 'we got that',
    };
    return {
      Detected: detected,
      Healthy: healthy,
      HealthDescription: healthy ? 'Driver is healthy' : 'Uh oh',
      UpdateTime: faker.date.past(5 / 365, REF_DATE),
      Attributes: Math.random() > 0.3 && detected ? attributes : null,
    };
  };
github CenterForOpenScience / ember-osf-web / mirage / factories / meeting.ts View on Github external
endDate() {
        return faker.date.past(5, new Date(2020, 0, 0));
    },
    logoUrl() {
github mtmckenna / croissant-runner-ember / app / mirage / factories / hi-score.js View on Github external
import Mirage, {faker} from 'ember-cli-mirage';

export default Mirage.Factory.extend({
   initials: function() {
     return faker.hacker.abbreviation().substring(0,3).toUpperCase();
   },

   score: function() {
     return faker.random.number({
       'min': 10,
       'max': 100
     });
   },

   createdAt: faker.date.past
});
github CenterForOpenScience / ember-osf-web / mirage / factories / draft-registration.ts View on Github external
datetimeUpdated() {
        return faker.date.past(2, new Date(2018, 0, 0));
    },
github hashicorp / levant / vendor / github.com / hashicorp / nomad / ui / mirage / factories / allocation.js View on Github external
createTime() {
    return faker.date.past(2 / 365, new Date(this.modifyTime / 1000000)) * 1000000;
  },
github CenterForOpenScience / ember-osf-web / mirage / factories / node.ts View on Github external
dateCreated() {
        return faker.date.past(1, new Date(2015, 0, 0));
    },
    currentUserCanComment: true,
github CenterForOpenScience / ember-osf-web / mirage / factories / registration.ts View on Github external
dateWithdrawn() {
            return faker.date.past(1, new Date(2019, 0, 0));
        },
    },