@attivio/suit
Version:
Attivio SUIT, the Search UI Toolkit, is a library for creating search clients for searching the Attivio platform.
64 lines (52 loc) • 3.11 kB
JavaScript
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
import { Enum } from 'enumify';
/**
* Enumerated values for possible date formats used by the
* formatDate() and formatDateString() methods.
*/
var DateFormat = function (_Enum) {
_inherits(DateFormat, _Enum);
function DateFormat() {
_classCallCheck(this, DateFormat);
return _possibleConstructorReturn(this, _Enum.apply(this, arguments));
}
return DateFormat;
}(Enum);
/** The ISO-like format that the Attivio APIs expect. */
export { DateFormat as default };
var ATTIVIO = 'ATTIVIO';
/** the ISO-8601 format, e.g., '2017-09-07T10:29-05:00' */
var ISO_8601 = 'ISO_8601';
/** a short date with just numbers, e.g., '09/07/2017' */
var SHORT_DATE = 'SHORT_DATE';
/** a date using the abbreviated month name, e.g., 'Sep 8, 2017' */
var MEDIUM_DATE = 'MEDIUM_DATE';
/** a date including the day of the week and the full month name: e.g., 'Thursday, September 8, 2017' */
var LONG_DATE = 'LONG_DATE';
/** A simple time format, e.g, '10:29 AM' */
var SHORT_TIME = 'SHORT_TIME';
/** A full time format, with seconds: e.g., '10:29:52 AM' */
var LONG_TIME = 'LONG_TIME';
/** The month and year of the date: e.g., 'Sep 2017' */
var SHORT_MONTH = 'SHORT_MONTH';
/** The month and year of the date: e.g., 'September 2017' */
var LONG_MONTH = 'LONG_MONTH';
/** The abbreviated 2-digit year: e.g. ’17 */
var SHORT_YEAR = 'SHORT_YEAR';
/** The full year: e.g. 2017 */
var LONG_YEAR = 'LONG_YEAR';
/** The short date and the short time, combined: e.g., '09/07/2017 10:29 AM' */
var SHORT = 'SHORT';
/** The medium date and the short time, combined: e.g., 'Sep 8, 2017 10:29 AM' */
var MEDIUM = 'MEDIUM';
/** The long date and the long time, combined: e.g., 'Thursday, September 8, 2017 10:29:52 AM' */
var LONG = 'LONG';
/** The month and day of the month with no time or year: e.g., 'March 4' */
var DAY_OF_MONTH = 'DAY_OF_MONTH';
/** A simple hour, in 12-hour format with AM or PM: e.g., '2 days ago' */
var HOUR = 'HOUR';
/** A distance 'ago' in time before now: e.g., '2 days ago' */
var AGO = 'AGO';
DateFormat.initEnum([ATTIVIO, ISO_8601, SHORT_DATE, MEDIUM_DATE, LONG_DATE, SHORT_TIME, LONG_TIME, SHORT_MONTH, LONG_MONTH, SHORT_YEAR, LONG_YEAR, SHORT, MEDIUM, LONG, DAY_OF_MONTH, HOUR, AGO]);