mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-29 12:09:20 +03:00
searchSubtractFormatDateHelper to native as moment.js not needed
This commit is contained in:
parent
45fa12be42
commit
327e6f65cd
3 changed files with 10 additions and 19 deletions
|
|
@ -39,17 +39,6 @@ export function momentNowUnix() {
|
|||
return _momentNow || 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {number} date
|
||||
* @returns {string}
|
||||
*/
|
||||
export function searchSubtractFormatDateHelper(date) {
|
||||
return momentNow()
|
||||
.clone()
|
||||
.subtract(date, 'days')
|
||||
.format('YYYY.MM.DD');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Object} m
|
||||
* @returns {string}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ import ko from 'ko';
|
|||
|
||||
import { trim } from 'Common/Utils';
|
||||
import { i18n, trigger as translatorTrigger } from 'Common/Translator';
|
||||
import { searchSubtractFormatDateHelper } from 'Common/Momentor';
|
||||
|
||||
import MessageStore from 'Stores/User/Message';
|
||||
|
||||
|
|
@ -120,7 +119,10 @@ class AdvancedSearchPopupView extends AbstractViewNext {
|
|||
}
|
||||
|
||||
if (-1 < this.selectedDateValue()) {
|
||||
result.push('date:' + searchSubtractFormatDateHelper(this.selectedDateValue()) + '/');
|
||||
let d = new Date(), pad2 = v => 10 > v ? '0' + v : v;
|
||||
d.setDate(d.getDate() - this.selectedDateValue());
|
||||
// d.format('Y.m.d');
|
||||
result.push('date:' + d.getFullYear()+'.'+pad2(d.getMonth()+1)+'.'+pad2(d.getDate()) + '/');
|
||||
}
|
||||
|
||||
if (text) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue