mcrm-mobile 1.1.1 → 1.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -87,6 +87,7 @@ CommonUtils.formattingTime = function (date, format) {
87
87
  var hour = date.getHours();
88
88
  var min = date.getMinutes();
89
89
  var seconds = date.getSeconds();
90
+ var milliseconds = date.getMilliseconds();
90
91
  var monthS = CommonUtils.zeroPadding(function (val) {
91
92
  return val < 10;
92
93
  }, month);
@@ -102,7 +103,10 @@ CommonUtils.formattingTime = function (date, format) {
102
103
  var secondsS = CommonUtils.zeroPadding(function (val) {
103
104
  return val < 10;
104
105
  }, seconds);
105
- var desc = format.replace("yyyy", year).replace("MM", monthS).replace("dd", dayS).replace("hh", hourS).replace("mm", minS).replace("ss", secondsS);
106
+ var millisecondsS = CommonUtils.zeroPadding(function (val) {
107
+ return val < 10;
108
+ }, milliseconds);
109
+ var desc = format.replace("yyyy", year).replace("MM", monthS).replace("dd", dayS).replace("hh", hourS).replace("mm", minS).replace("ss", secondsS).replace("SSS", millisecondsS);
106
110
  return {
107
111
  date: date,
108
112
  desc: desc,
@@ -111,7 +115,8 @@ CommonUtils.formattingTime = function (date, format) {
111
115
  day: day,
112
116
  hour: hour,
113
117
  min: min,
114
- seconds: seconds
118
+ seconds: seconds,
119
+ milliseconds: milliseconds
115
120
  };
116
121
  };
117
122
 
@@ -133,9 +138,16 @@ CommonUtils.getMonthBefore = function (monthBefore, currDate) {
133
138
  month = currMonth - monthBefore;
134
139
  year = currYear;
135
140
 
136
- if (month <= 0) {
137
- month += 12;
138
- year--;
141
+ if (monthBefore > 0) {
142
+ if (month <= 0) {
143
+ month += 12;
144
+ year--;
145
+ }
146
+ } else {
147
+ if (month > 12) {
148
+ month -= 12;
149
+ year++;
150
+ }
139
151
  }
140
152
 
141
153
  day = CommonUtils.getNumForMonth(year, month);