angular-cron-jobs / angular-cron-jobs Goto Github PK
View Code? Open in Web Editor NEWUI Component For Creating Cron Job Syntax To Send To Server
Home Page: http://angular-cron-jobs.github.io/angular-cron-jobs/#/
License: MIT License
UI Component For Creating Cron Job Syntax To Send To Server
Home Page: http://angular-cron-jobs.github.io/angular-cron-jobs/#/
License: MIT License
Hello,
When selecting Month interval the error bellow appears in console:
angular.js:13920 TypeError: value.forEach is not a function
at SelectController.writeNgOptionsMultiple [as writeValue] (angular.js:28925)
at NgModelController.ngModelCtrl.$render (angular.js:31205)
at ngModelWatch (angular.js:27815)
at Scope.$digest (angular.js:17515)
at Scope.$apply (angular.js:17790)
at HTMLSelectElement. (angular.js:31142)
at defaultHandlerWrapper (angular.js:3497)
at HTMLSelectElement.eventHandler (angular.js:3485)
Issue can be reproduced on you demo website when using allowMultiple: true
What can produce this error ?
What is the influence on the final result ?
Thanks
I have also put the same question here on StackOverflow:
http://stackoverflow.com/questions/30773885/why-angular-cron-jobs-generates-the-same-cron-expression-for-every-minute-ev
Would it be possible to add support for ranges in times and lists eg 0-4.
A list would be:
1/3/5 * * * *
would be every 1st, 3rd and 5th minute.
For now only every day
Hello,
Currently angular-mocks is listed as a normal dependency. This causes problems (in our setup at least) as angular-mocks will be part of the final distro.
Should it be listed in the "devDependencies" instead? Like this:
"dependencies": {
"angular": "*"
},
"devDependencies": {
"angular-mocks": "*"
}`
I am using the cron expression generated by your utility with Quartz scheduler and the validation fails because we are not specifying the year part.
Is it possible to add a configuration provider to angular-service so that user can optionally turn this on.
Changing
var cron = ['*', '*', '*', '*', '*'];
to
var cron = ['*', '*', '*', '*', '*', '*'];
in service.setCron method of cronService fixes this issue.
there is some way that i can translate the months and weekdays without changing the source code?
It seems in cronService.setCron, the frequency base is a string so all the number comparisons are failing. Will push the fix over the weekend if I get time.
Hi- great directive, thanks!
It would be useful to be able to use a multi-select for the second input field, so multiple days could be selected if 'Every Week' is selected, or multiple months selected if 'Every Year'.
Anytime I import this module in the Ionic 2 / Angular 2 using the ngModule decorator, I get the
"angular is not a function".
Is there a way around this or is there an angular2 version of this module?
I have added custom in base frequency with value as 7. When i add job that time it shows me custom under cron drop down but in edit case when i pass custom expression in model it doesn't change the value of drop-down. Need help of how can i achieve this.
Is there a way to update the cron data after it's already been initialized?
For example after a new file is loaded from disk I'd like to update the cron with the data from the file but I'm not sure if this is currently possible.
I know the first time it renders it will render with cronInitData but I don't see a way to set the data after it's been initialized once.
Thanks.
Hi everyone.
I would like to convert output string as ISO 8601 syntax format.
For example every minute would be "R/P1M" insted of * * * * *
Thanks
if you try to do every day at midnight (0 minutes 0 hour) the cron string is * * * * * it should be:
00 00 * * *
After some try I discovered, according to fromCron, that the cron string is parsed as m h D w M y
, but, according to crontab documentation, should be m h D M w y
.
This generates weekly task which results in invalid cron.
The generated cron seems to suffer of the same issue.
Would you ever consider making an angular material version? I think this would be a great addition.
While working on merging init and output I noticed that ever since v2.0.0, the init does not work because of the changes to cronService.fromCron()
function.
Steps to reproduce:
Particularly, it seems that if's failing because of lines line that:
frequency.minuteValue = [parseInt(cron[0])];
... where the parsed value is wrapped in an array.
Not sure if this is a known "work in progress" situation or not, so I'm wondering if I should poke around this or let you fix this one and proceed with my stuff after.
Now it only supports every minute,but not supoort "every N minutes", for example ”*/5 * * * *" .
Quick fix, for lines 208-216, there is an additional comma after day 'Saturday' in .filter('dayName', ...).
This is problematic as it's obviously not great syntactically but it also makes Closure compiler fail.
It would be great to be able to use a custom template.
I cannot integrate this into my website because I need support for foreign languages and support for custom design.
Maybe allow something like this ?
<cron-selection output="myOutput">
<my-custom-html-here>
Custom html that comply with angular-cron-jobs requirements
that also includes my design and translations.
</my-custom-html-here>
</cron-selection>
Thank you for your awesome work ! :)
Hey,
Thanks for the library!
I get 404 when trying to reach the demo: http://jacobscarter.github.io/angular-cron-jobs
The readme says that configs should be set on
$scope.myConfig = {
option: {
allowWeek : false,
allowMonth : false,
allowYear : false
}
}
But the directive looks for config.options
Thanks!
Hi
i have added html code as
"cron-selection config="cronOptions" ng-model="cronExpression""
and in controller
$scope.cronExpression = "0 0 * * *"
$scope.cronOptions = {
allowMultiple: true,
quartz: true
};
but the problem is when i have select a time thats not update the $scope.cronExpression ????
Steps to reproduce:
Similar thing happens when your first select "Month" and go up to "Year".
I poked around a bit, but could not find where exactly the issue is.
switch (input) {
case 1:
return '1st';
case 2:
return '2nd';
case 3:
return '3rd';
case 21:
return '21st';
case 22:
return '22nd';
case 23:
return '23rd';
case 31:
return '31st';
case null:
return null;
default:
return input + 'th';
}
Is there a way to disable the inputs? Tried adding ng-disabled attribute but no success.
I'm using this directive as a enhancement for an text input field in a server-side generated form. Currently I'm binding the output to my own hidden field so that the form can be submitted via POST, but it would be nice if this could be integrated into the directive.
E,g If the element the directive is applied to has a 'name' attribute, copy it to the inner select input
I may attempt a pull request for this if other may find it useful.
I'm trying to perform a basic configuration by removing select options Minute and Hour following the instruction given on Demo with config. Even at the demo page the component is not behaving as expected (both month and year are still there).
At first view $scope.config
is undefined
when app reaches the code where the options should be removed.
Hi,
thank you for this module!
It is possible to provide a selection to set the output to null
or an empty string?
Many thanks in advance!
Cheers,
Stefan
Hello,
I noticed a bug on http://angular-cron-jobs.github.io/angular-cron-jobs/#/#noSelectSample demo page.
Steps to reproduce:
Result:
OUTPUT: 10 * * * NaN
I guess 'NaN' is not correct?
When I used the directive, I found that the output value is not set on the scope. I could not access it using $scope in the controller.
It is not possible to know if value beet changed. I used $watch, but it does not same as blur or change.
I have a case when I need to know what base
user selected. I know that internally there is a variable for that, but maybe we could expose this info to the outside
?
While we are at it, perhaps it would be a good idea to also expose other potentially useful stuff.
What do you think about it?
if my server returns cronTime * * * * *
(every minute), it'll run fromCron()
function and wrongfully set frequency.base
to every hour. See related lines of code
This should be:
if (cron[0] === '*' && cron[1] === '*' && cron[2] === '*' && cron[3] === '*' && cron[4] === '*') {
frequency.base = 1; // every minute
} else if (cron[1] === '*' && cron[2] === '*' && cron[3] === '*' && cron[4] === '*') {
frequency.base = 2; // every hour
} else if(cron[2] === '*' && cron[3] === '*' && cron[4] === '*') {
frequency.base = 3; // every day
} else if(cron[2] === '*' && cron[3] === '*') {
frequency.base = 4; // every week
} else if(cron[3] === '*' && cron[4] === '*') {
frequency.base = 5; // every month
} else if(cron[4] === '*') {
frequency.base = 6; // every year
}
Using for...in loop over array is failing in some of the new javascript based frameworks. That loop is meant to be used to loop into objects only.
Currently the output
property for the cron-selection
will default to * * * * *
even if nothing is selected. That does not seem like the right behavior.
Some forms might require cron to be selected. Others might not.
Because it's defaulted to a value, there is no way to enforce required
validation.
Also, on a side note (this should have been a separate issue), what's the reason for separating attributes init
and output
?
I haven't came across a situation when I'd need to bind these to different props. Why not combine them into ng-model
?
First thing is first - awesome work!
Now the issue: I'm trying to create a different template using angular-material and therefore converting all <select>
elements into <md-select>
It appears that angular's select
directive is more forgiving on the values, which is why code works for the default template. However, angular-materials directive is having troubles because of the lines like below and similar:
if(n && n.base && n.base === '4') {
It seems that all values are initially declared as integers. However, in the if statements the comparison uses string value. This should be:
if(n && n.base && n.base === 4) {
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.