indexPattern.js 456 B

12345678910111213141516171819202122232425
  1. define([
  2. 'lodash',
  3. 'moment',
  4. ],
  5. function (_, moment) {
  6. 'use strict';
  7. function IndexPattern(pattern, interval) {
  8. this.pattern = pattern;
  9. this.interval = interval;
  10. }
  11. IndexPattern.prototype.getIndexForToday = function() {
  12. if (this.interval) {
  13. return moment().format(this.pattern);
  14. } else {
  15. return this.pattern;
  16. }
  17. };
  18. IndexPattern.prototype.getIndexList = function(from, to) {
  19. };
  20. return IndexPattern;
  21. });