123456789101112131415161718192021222324252627282930313233343536 |
- const serverUrl = 'https://test.bizgaze.app/';
- let _baseUserInfo = atob(document.cookie.split('=')[1]);
- let baseUserInfo = JSON.parse(_baseUserInfo).result;
- let baseSessionId = baseUserInfo.sessionId;
-
- function getData(url) {
- var datastr = null;
- var method = "GET";
- let serviceurl = serverUrl + url;
-
- return $.ajax({
- type: method,
- url: serviceurl,
- crossDomain: true,
- contentType: "application/json",
- cache: true,
- jsonp: false,
- data: datastr,
- beforeSend: function(xhr) {
- if (baseUserInfo != undefined && baseUserInfo != null) {
- xhr.setRequestHeader("Authorization", "Basic " + baseSessionId);
- xhr.setRequestHeader('geoposition', 0 + ':' + 0);
- }
- }
- });
- }
-
- function formatLocal(dateTime) {
- var date = moment.utc(dateTime).local();
- var difmonths = moment().diff(date, 'months');
-
- if (difmonths == 0) {
- return this.formatPeriod(date);
- }
- return date.format("DD MMM, YYYY HH:mm");
- }
|