next month filter

This commit is contained in:
yuri
2017-11-15 16:01:54 +02:00
parent 5a990de0d6
commit ffeb600382
4 changed files with 10 additions and 2 deletions

View File

@@ -1127,6 +1127,13 @@ class Base
$attribute . '<' => $dt->add(new \DateInterval('P1M'))->format('Y-m-d'),
);
break;
case 'nextMonth':
$dt = new \DateTime();
$part['AND'] = array(
$attribute . '>=' => $dt->modify('first day of next month')->format('Y-m-d'),
$attribute . '<' => $dt->add(new \DateInterval('P1M'))->format('Y-m-d'),
);
break;
case 'currentQuarter':
$dt = new \DateTime();
$quarter = ceil($dt->format('m') / 3);

View File

@@ -522,6 +522,7 @@
"future": "Future",
"currentMonth": "Current Month",
"lastMonth": "Last Month",
"nextMonth": "Next Month",
"currentQuarter": "Current Quarter",
"lastQuarter": "Last Quarter",
"currentYear": "Current Year",

View File

@@ -42,7 +42,7 @@ Espo.define('views/fields/date', 'views/fields/base', function (Dep) {
validations: ['required', 'date', 'after', 'before'],
searchTypeList: ['lastSevenDays', 'ever', 'isEmpty', 'currentMonth', 'lastMonth', 'currentQuarter', 'lastQuarter', 'currentYear', 'lastYear', 'today', 'past', 'future', 'lastXDays', 'nextXDays', 'olderThanXDays', 'afterXDays', 'on', 'after', 'before', 'between'],
searchTypeList: ['lastSevenDays', 'ever', 'isEmpty', 'currentMonth', 'lastMonth', 'nextMonth', 'currentQuarter', 'lastQuarter', 'currentYear', 'lastYear', 'today', 'past', 'future', 'lastXDays', 'nextXDays', 'olderThanXDays', 'afterXDays', 'on', 'after', 'before', 'between'],
setup: function () {
Dep.prototype.setup.call(this);

View File

@@ -36,7 +36,7 @@ Espo.define('views/fields/datetime', 'views/fields/date', function (Dep) {
validations: ['required', 'datetime', 'after', 'before'],
searchTypeList: ['lastSevenDays', 'ever', 'isEmpty', 'currentMonth', 'lastMonth', 'currentQuarter', 'lastQuarter', 'currentYear', 'lastYear', 'today', 'past', 'future', 'lastXDays', 'nextXDays', 'olderThanXDays', 'afterXDays', 'on', 'after', 'before', 'between'],
searchTypeList: ['lastSevenDays', 'ever', 'isEmpty', 'currentMonth', 'lastMonth', 'nextMonth', 'currentQuarter', 'lastQuarter', 'currentYear', 'lastYear', 'today', 'past', 'future', 'lastXDays', 'nextXDays', 'olderThanXDays', 'afterXDays', 'on', 'after', 'before', 'between'],
timeFormatMap: {
'HH:mm': 'H:i',