Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mean-date-filter

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mean-date-filter - npm Package Compare versions

Comparing version 0.0.9 to 0.0.11

2

package.json
{
"name": "mean-date-filter",
"version": "0.0.9",
"version": "0.0.11",
"description": "Filter with start and end dates. Includes datepickers and quick select buttons.",

@@ -5,0 +5,0 @@ "author": {

@@ -10,4 +10,3 @@ 'use strict';

scope: {
startDate: '=',
endDate: '=',
dates: '=',
mode: '@',

@@ -26,11 +25,8 @@ clearText: '@',

link: function($scope, element, attrs) {
$scope.$watch(attrs.startDate, function(startDate) {
$scope.startDate = startDate;
$scope.$watchCollection('dates', function(dates) {
$scope.dates = dates;
});
$scope.$watch(attrs.endDate, function(endDate) {
$scope.endDate = endDate;
$scope.$watch('mode', function(mode) {
changeMode(mode, $scope.save);
});
$scope.$watch(attrs.mode, function(mode) {
changeMode(mode());
});
$scope.opened = {

@@ -47,9 +43,9 @@ start: false,

$scope.week = function() {
changeMode('week', $scope.save);
$scope.mode = 'week';
};
$scope.month = function() {
changeMode('month', $scope.save);
$scope.mode = 'month';
};
$scope.year = function() {
changeMode('year', $scope.save);
$scope.mode = 'year';
};

@@ -59,12 +55,11 @@

if (mode) {
$scope.mode = mode;
if (mode === 'year') {
$scope.startDate = moment(new Date()).subtract(1, 'year').toDate();
$scope.endDate = moment(new Date()).subtract(1, 'days').toDate();
$scope.dates.startDate = moment(new Date()).subtract(1, 'year').toDate();
$scope.dates.endDate = moment(new Date()).subtract(1, 'days').toDate();
} else if (mode === 'month') {
$scope.startDate = moment(new Date()).subtract(1, 'month').toDate();
$scope.endDate = moment(new Date()).subtract(1, 'days').toDate();
$scope.dates.startDate = moment(new Date()).subtract(1, 'month').toDate();
$scope.dates.endDate = moment(new Date()).subtract(1, 'days').toDate();
} else if (mode === 'week') {
$scope.startDate = moment(new Date()).subtract(7, 'days').toDate();
$scope.endDate = moment(new Date()).subtract(1, 'days').toDate();
$scope.dates.startDate = moment(new Date()).subtract(7, 'days').toDate();
$scope.dates.endDate = moment(new Date()).subtract(1, 'days').toDate();
}

@@ -75,3 +70,3 @@ if (typeof callback === 'function') {

}
}
};

@@ -83,3 +78,3 @@ $scope.resetMode = function() {

$scope.save = function() {
MeanDateFilter.setDateFilter($scope.startDate, $scope.endDate, $scope.mode, function(data) {});
MeanDateFilter.setDateFilter($scope.dates.startDate, $scope.dates.endDate, $scope.mode, function(data) {});
};

@@ -90,6 +85,6 @@

if (typeof data.startDate !== 'undefined') {
$scope.startDate = moment(data.startDate).toDate();
$scope.dates.startDate = moment(data.startDate).toDate();
}
if (typeof data.endDate !== 'undefined') {
$scope.endDate = moment(data.endDate).toDate();
$scope.dates.endDate = moment(data.endDate).toDate();
}

@@ -100,10 +95,10 @@ if (typeof data.mode !== 'undefined') {

});
}
};
load();
if (!$scope.startDateText) {
$scope.startDateText = 'Start Date';
if (!$scope.dates.startDateText) {
$scope.dates.startDateText = 'Start Date';
}
if (!$scope.endDateText) {
$scope.endDateText = 'End Date';
if (!$scope.dates.endDateText) {
$scope.dates.endDateText = 'End Date';
}

@@ -110,0 +105,0 @@ if (!$scope.weekText) {

@@ -1,4 +0,4 @@

# Date Filter Mean Package
# Date Filter
Filter with start and end dates. Includes datepickers and quick select buttons.
Date Filter is a mean.io package that allows user to specify starting and ending date with datepickers and quick select buttons.

@@ -13,3 +13,10 @@ ## Features

## Simple Usage
## Dependencies
- Requires MEAN 0.4.0 http://mean.io
- Other dependencies are installed automatically by npm.
## Installation
npm install mean-date-filter --save
## Basic Usage
`<div mode="week" start-date="startDate" end-date="endDate" mean-date-filter></div>`

@@ -16,0 +23,0 @@

@@ -1,2 +0,2 @@

'use strict'
'use strict';

@@ -11,4 +11,5 @@ var mongoose = require('mongoose'),

}).exec(function(err, dateFilters) {
var dateFilter;
if (dateFilters.length) {
var dateFilter = dateFilters[0];
dateFilter = dateFilters[0];
dateFilter.startDate = req.body.startDate;

@@ -18,3 +19,3 @@ dateFilter.endDate = req.body.endDate;

} else {
var dateFilter = new DateFilter(req.body);
dateFilter = new DateFilter(req.body);
}

@@ -32,3 +33,3 @@

});
}
};

@@ -50,2 +51,2 @@ exports.load = function(req, res) {

});
}
};

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc