Skip to content

Commit

Permalink
Merge branch 'master' of github.com:wachterjohannes/SuluAutomationBun…
Browse files Browse the repository at this point in the history
…dle into develop
  • Loading branch information
wachterjohannes committed Sep 15, 2017
2 parents dd191f1 + b60da10 commit fef87c2
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .styleci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ disabled:
- phpdoc_align
- phpdoc_indent
- phpdoc_to_comment
- blank_line_before_break
- blankline_after_open_tag
- function_declaration
- single_line_class_definition

1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ matrix:

before_script:
- phpenv config-rm xdebug.ini
- phpenv config-add Tests/travis.php.ini
- composer self-update
- composer update $COMPOSER_FLAGS
- ./Tests/app/console doctrine:database:create
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# SuluAutomationBundle

[![Build Status](https://travis-ci.org/sulu/SuluAutomationBundle.svg)](https://travis-ci.org/sulu/SuluAutomationBundle)
[![StyleCI](https://styleci.io/repos/61883398/shield)](https://styleci.io/repos/61883398)
[![StyleCI](https://styleci.io/repos/81314407/shield)](https://styleci.io/repos/81314407)

The SuluAutomationBundle provides a way to manages future tasks which can be scheduled for entities in the Sulu-Admin.
For example schedule the publishing of a page to a specific datetime in the future.
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 14 additions & 4 deletions Resources/public/js/components/automation-tab/overlay/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ define(['services/suluautomation/task-manager', 'text!./form.html'], function(ma

'use strict';

var constants = {
longDate: "yyyy'-'MM'-'dd'T'HH':'mm':'ss",
dateFormatWithTimezone: "yyyy'-'MM'-'dd'T'HH':'mm':'sszz'00'",
};

return {

defaults: {
Expand Down Expand Up @@ -99,21 +104,26 @@ define(['services/suluautomation/task-manager', 'text!./form.html'], function(ma
},

decodeData: function(data) {
var date = !!data.schedule ? new Date(data.schedule) : null;
var date = !!data.schedule ?
Globalize.parseDate(data.schedule, constants.dateFormatWithTimezone) :
null;

return {
handlerClass: data.handlerClass,
date: !!date ? Globalize.format(date, "yyyy'-'MM'-'dd") : '',
time: !!date ? Globalize.format(date, "HH':'mm':'ss") : ''
}
};
},

encodeData: function(data) {
return {
id: this.options.id,
handlerClass: data.handlerClass,
schedule: Globalize.format(new Date(data.date + ' ' + data.time), "yyyy'-'MM'-'dd'T'HH':'mm':'ssz'00'")
}
schedule: Globalize.format(
Globalize.parseDate(data.date + 'T' + data.time, constants.dateFormat),
constants.dateFormatWithTimezone
)
};
},

removeTask: function() {
Expand Down
2 changes: 2 additions & 0 deletions Tests/travis.php.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
memory_limit = 2048M

0 comments on commit fef87c2

Please sign in to comment.