{"action":"created","comment":{"url":"https://api.github.com/repos/civicrm/civihr/pulls/comments/61996906","id":61996906,"diff_hunk":"@@ -53,6 +54,9 @@ define([\n             angular.copy(entity,$scope.entity);\n             angular.copy(files,$scope.files);\n \n+            $scope.entity.details.period_start_date = convertToDateObject($scope.entity.details.period_start_date);","path":"hrjobcontract/js/src/job-contract/controllers/modal/modal-contract.js","position":23,"original_position":19,"commit_id":"ce621c0990dbb842c30bba94250f50b77351351e","original_commit_id":"a6c7e44b3f4e8c765ce121108c05712e9b9f4a70","user":{"login":"AkA84","id":6400898,"avatar_url":"https://avatars.githubusercontent.com/u/6400898?v=3","gravatar_id":"","url":"https://api.github.com/users/AkA84","html_url":"https://github.com/AkA84","followers_url":"https://api.github.com/users/AkA84/followers","following_url":"https://api.github.com/users/AkA84/following{/other_user}","gists_url":"https://api.github.com/users/AkA84/gists{/gist_id}","starred_url":"https://api.github.com/users/AkA84/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AkA84/subscriptions","organizations_url":"https://api.github.com/users/AkA84/orgs","repos_url":"https://api.github.com/users/AkA84/repos","events_url":"https://api.github.com/users/AkA84/events{/privacy}","received_events_url":"https://api.github.com/users/AkA84/received_events","type":"User","site_admin":false},"body":"Not sure I understand the comment correctly, but the `$filter` is used in the `convertToDateObject` function:\r\n```js\r\nfunction convertToDateObject(dateString) {\r\n    var dateObj = $filter('formatDate')(dateString, Date);\r\n\r\n    return dateObj !== 'Unspecified' ? dateObj : dateString;\r\n}\r\n```\r\nthe reason for this was because the filter still returns the very specific `Unspecified` string (instead of, say, `undefined`). I didn't want to change the return value of the filter itself and risking to introduce yet more breaking changes, so I'm using the `convertToDateObject` to make sure that the invalid (usually `null`) date is returned in case the filter returns `Unspecified`. The same logic is applied in some other components in other extensions","created_at":"2016-05-04T07:16:01Z","updated_at":"2016-05-04T07:16:01Z","html_url":"https://github.com/civicrm/civihr/pull/920#discussion_r61996906","pull_request_url":"https://api.github.com/repos/civicrm/civihr/pulls/920","_links":{"self":{"href":"https://api.github.com/repos/civicrm/civihr/pulls/comments/61996906"},"html":{"href":"https://github.com/civicrm/civihr/pull/920#discussion_r61996906"},"pull_request":{"href":"https://api.github.com/repos/civicrm/civihr/pulls/920"}}},"pull_request":{"url":"https://api.github.com/repos/civicrm/civihr/pulls/920","id":68703195,"html_url":"https://github.com/civicrm/civihr/pull/920","diff_url":"https://github.com/civicrm/civihr/pull/920.diff","patch_url":"https://github.com/civicrm/civihr/pull/920.patch","issue_url":"https://api.github.com/repos/civicrm/civihr/issues/920","number":920,"state":"open","locked":false,"title":"PCHR-874: Update to newest ui-boostrap version","user":{"login":"AkA84","id":6400898,"avatar_url":"https://avatars.githubusercontent.com/u/6400898?v=3","gravatar_id":"","url":"https://api.github.com/users/AkA84","html_url":"https://github.com/AkA84","followers_url":"https://api.github.com/users/AkA84/followers","following_url":"https://api.github.com/users/AkA84/following{/other_user}","gists_url":"https://api.github.com/users/AkA84/gists{/gist_id}","starred_url":"https://api.github.com/users/AkA84/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AkA84/subscriptions","organizations_url":"https://api.github.com/users/AkA84/orgs","repos_url":"https://api.github.com/users/AkA84/repos","events_url":"https://api.github.com/users/AkA84/events{/privacy}","received_events_url":"https://api.github.com/users/AkA84/received_events","type":"User","site_admin":false},"body":"## Problem\r\nWe are currently using a very old (actually the very first) version of [ui-boostrap](https://angular-ui.github.io/bootstrap/), v.`0.12.0`, which obviously needs to be updated\r\n\r\n## Solution\r\nUpdating it to v.`1.3.2`, latest version available to date. Of course this introduced a variety of backward compatibility breaking changes, that needed to be addressed\r\n\r\n#### Prefixes\r\nAll the directive and services have now a `uib` (for the former) and a `$uib` (for the latter) prefixes, that needed to be added following this [migration guide](https://github.com/angular-ui/bootstrap/wiki/Migration-guide-for-prefixes)\r\n\r\n#### `$uibModal` interface\r\nThe service had initially a `targetDomEl` property to indicate the DOM element to which the modal should be attached. The newer version has changed it to an `appendTo` property\r\n\r\n#### CSS\r\nThe library comes with custom css that gets injected directly via javascript to the `<head>` element:\r\n```js\r\nangular.module('ui.bootstrap.carousel').run(function() {\r\n    !angular.$$csp().noInlineStyle &&\r\n    !angular.$$uibCarouselCss &&\r\n    angular.element(document).find('head').prepend('<style type=\"text/css\"></style>');    \r\n    angular.$$uibCarouselCss = true;\r\n});\r\n```\r\nGiven that our custom style is namespaced, the aforementioned css would not get applied to our theme given it would lay outside of the namespace (the namespace is not usually applied to the `<html>` tag in our cases). To solve this problem, the css has been copied over a proper scss partials who would then be included in the theme\r\n```sass\r\n#{$bootstrap-namespace} {\r\n    /* ... */\r\n    @import \"vendor/ui-bootstrap/ui-bootstrap\";\r\n    /* ... */\r\n}\r\n```\r\nAdditionally, our theme had already the datepicker style customized in an override partial, and the selectors of the overriding rules had to be updated to match the new classes used by the library\r\n\r\nUnfortunately some of the extensions still don't use the common theme provided by the `org.civicrm.(bootstrap|bootstrapcivicrm|bootstrapcivihr)` extensions, so the CSS had to be, temporarily, copied in their local scss folders\r\n\r\n#### `ngAnimate`\r\nThe library now relies on the `ngAnimate` module to animate the components, and as such it has been added to the extensions' applications\r\n\r\n#### `prevent-animations` directive\r\nThe addition of `ngAnimate` would create a display issue with the `textAngular` directive in modals, flashing for a moment the `<textarea>` underneath.\r\n\r\nA `prevent-animations` directive have been added as a `common/` dependency to avoid the issue, as described [here](https://github.com/fraywing/textAngular/issues/280):\r\n```html\r\n<div text-angular\r\n    prevent-animations\r\n    ta-toolbar=\"[['bold','italics','underline','strikeThrough','ul','ol','undo','redo','clear']]\"\r\n    ng-model=\"task.details\">\r\n</div>\r\n```\r\nThe directive has also been added to the `loading` directive, given that `ngAnimate` would create a conflict with that as well (showing the spinner for longer than necessary)\r\n```html\r\n<div>\r\n    <div prevent-animations class=\"crm_spinner\" ng-show=\"!show\">\r\n        <span class=\"crm_spinner__img\"></span>\r\n    </div>\r\n    <div ng-transclude ng-show=\"show\"></div>\r\n</div>\r\n```\r\n#### `formatDate` filter\r\nThe `formatDate` filter has now been augmented to be able to convert a string to a `Date` object. A `Date` can be passed as the `format` argument:\r\n```js\r\n$filter('formatDate')('22-01-2016', Date); // Fri Jan 22 2016 00:00:00 GMT+0100 (CET)\r\n```\r\n\r\n#### Datepicker\r\nThe Datepicker popup was the directive that proved most challenging in the migration, mainly because it now accepts **only** `Date` objects as the value of the `ng-model` property, while in the earliest version it would accept also basic date strings\r\n\r\n##### Custom decorators\r\nWe had in place some custom decorators to augment the `datepicker-popup` (now `uib-datepicker-popup`) directive. All of them have been removed* except one, the `uibDatepickerPopupDirective` decorator.\r\n\r\nThe role of this decorator, before this PR, was to enforce the `HR_settings.DATE_FORMAT` format under the hood, ignoring the format passed to the directive itself. Additionally, it would have a custom fix to prevent bad positioning of the popup when closer to the window border:\r\n```js\r\nattrs.datepickerPopup = HR_settings.DATE_FORMAT;\r\n\r\n/**\r\n * Calculates position of the datepicker popup.\r\n * @param {bool} isDatepickerOpen\r\n */\r\nvar adjustPopupPosition = function (isDatepickerOpen) {\r\n```\r\nThe amended version removes the `adjustPopupPosition` workaround (it's taken care by the library itself now), and provides a better handling of the date format, which can be overridden by passing the format to the directive as by original design\r\n```js\r\nattrs.uibDatepickerPopup = attrs.uibDatepickerPopup || HR_settings.DATE_FORMAT || 'yyyy-MM-dd';\r\n```\r\n\r\n_*Temporarily, we need to check if there is anything we need to keep using even with the new version_\r\n\r\n##### Custom `date-input` directive\r\nThe `date-input` directive was applied to all `datepicker-popup` directive. It has now been removed, as it was conflicting with how the directive now works\r\n\r\n##### Converting all passed datepicker's `ng-model` values to `Date` objects\r\nAll the `ng-model` values must now be `Date` objects when passed to the datepicker. This meant converting dates of tasks, assignments, job contracts, job roles, and appraisals from date strings to `Date` objects (to display them in the datepicker) and back (to save the selected date in the DB)","created_at":"2016-05-03T13:13:06Z","updated_at":"2016-05-04T07:16:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"72e31e6eaf1af948e2201f8d509285aaaaa46977","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/civicrm/civihr/pulls/920/commits","review_comments_url":"https://api.github.com/repos/civicrm/civihr/pulls/920/comments","review_comment_url":"https://api.github.com/repos/civicrm/civihr/pulls/comments{/number}","comments_url":"https://api.github.com/repos/civicrm/civihr/issues/920/comments","statuses_url":"https://api.github.com/repos/civicrm/civihr/statuses/ce621c0990dbb842c30bba94250f50b77351351e","head":{"label":"civicrm:PCHR-874-update-ui-bootstrap-2","ref":"PCHR-874-update-ui-bootstrap-2","sha":"ce621c0990dbb842c30bba94250f50b77351351e","user":{"login":"civicrm","id":136373,"avatar_url":"https://avatars.githubusercontent.com/u/136373?v=3","gravatar_id":"","url":"https://api.github.com/users/civicrm","html_url":"https://github.com/civicrm","followers_url":"https://api.github.com/users/civicrm/followers","following_url":"https://api.github.com/users/civicrm/following{/other_user}","gists_url":"https://api.github.com/users/civicrm/gists{/gist_id}","starred_url":"https://api.github.com/users/civicrm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/civicrm/subscriptions","organizations_url":"https://api.github.com/users/civicrm/orgs","repos_url":"https://api.github.com/users/civicrm/repos","events_url":"https://api.github.com/users/civicrm/events{/privacy}","received_events_url":"https://api.github.com/users/civicrm/received_events","type":"Organization","site_admin":false},"repo":{"id":10086903,"name":"civihr","full_name":"civicrm/civihr","owner":{"login":"civicrm","id":136373,"avatar_url":"https://avatars.githubusercontent.com/u/136373?v=3","gravatar_id":"","url":"https://api.github.com/users/civicrm","html_url":"https://github.com/civicrm","followers_url":"https://api.github.com/users/civicrm/followers","following_url":"https://api.github.com/users/civicrm/following{/other_user}","gists_url":"https://api.github.com/users/civicrm/gists{/gist_id}","starred_url":"https://api.github.com/users/civicrm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/civicrm/subscriptions","organizations_url":"https://api.github.com/users/civicrm/orgs","repos_url":"https://api.github.com/users/civicrm/repos","events_url":"https://api.github.com/users/civicrm/events{/privacy}","received_events_url":"https://api.github.com/users/civicrm/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/civicrm/civihr","description":"CiviHR","fork":false,"url":"https://api.github.com/repos/civicrm/civihr","forks_url":"https://api.github.com/repos/civicrm/civihr/forks","keys_url":"https://api.github.com/repos/civicrm/civihr/keys{/key_id}","collaborators_url":"https://api.github.com/repos/civicrm/civihr/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/civicrm/civihr/teams","hooks_url":"https://api.github.com/repos/civicrm/civihr/hooks","issue_events_url":"https://api.github.com/repos/civicrm/civihr/issues/events{/number}","events_url":"https://api.github.com/repos/civicrm/civihr/events","assignees_url":"https://api.github.com/repos/civicrm/civihr/assignees{/user}","branches_url":"https://api.github.com/repos/civicrm/civihr/branches{/branch}","tags_url":"https://api.github.com/repos/civicrm/civihr/tags","blobs_url":"https://api.github.com/repos/civicrm/civihr/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/civicrm/civihr/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/civicrm/civihr/git/refs{/sha}","trees_url":"https://api.github.com/repos/civicrm/civihr/git/trees{/sha}","statuses_url":"https://api.github.com/repos/civicrm/civihr/statuses/{sha}","languages_url":"https://api.github.com/repos/civicrm/civihr/languages","stargazers_url":"https://api.github.com/repos/civicrm/civihr/stargazers","contributors_url":"https://api.github.com/repos/civicrm/civihr/contributors","subscribers_url":"https://api.github.com/repos/civicrm/civihr/subscribers","subscription_url":"https://api.github.com/repos/civicrm/civihr/subscription","commits_url":"https://api.github.com/repos/civicrm/civihr/commits{/sha}","git_commits_url":"https://api.github.com/repos/civicrm/civihr/git/commits{/sha}","comments_url":"https://api.github.com/repos/civicrm/civihr/comments{/number}","issue_comment_url":"https://api.github.com/repos/civicrm/civihr/issues/comments{/number}","contents_url":"https://api.github.com/repos/civicrm/civihr/contents/{+path}","compare_url":"https://api.github.com/repos/civicrm/civihr/compare/{base}...{head}","merges_url":"https://api.github.com/repos/civicrm/civihr/merges","archive_url":"https://api.github.com/repos/civicrm/civihr/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/civicrm/civihr/downloads","issues_url":"https://api.github.com/repos/civicrm/civihr/issues{/number}","pulls_url":"https://api.github.com/repos/civicrm/civihr/pulls{/number}","milestones_url":"https://api.github.com/repos/civicrm/civihr/milestones{/number}","notifications_url":"https://api.github.com/repos/civicrm/civihr/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/civicrm/civihr/labels{/name}","releases_url":"https://api.github.com/repos/civicrm/civihr/releases{/id}","deployments_url":"https://api.github.com/repos/civicrm/civihr/deployments","created_at":"2013-05-15T20:06:06Z","updated_at":"2016-04-18T10:23:15Z","pushed_at":"2016-05-03T20:29:32Z","git_url":"git://github.com/civicrm/civihr.git","ssh_url":"git@github.com:civicrm/civihr.git","clone_url":"https://github.com/civicrm/civihr.git","svn_url":"https://github.com/civicrm/civihr","homepage":null,"size":20605,"stargazers_count":3,"watchers_count":3,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":21,"mirror_url":null,"open_issues_count":4,"forks":21,"open_issues":4,"watchers":3,"default_branch":"develop"}},"base":{"label":"civicrm:develop","ref":"develop","sha":"8f31f619694135761694616ee421eda75d99c737","user":{"login":"civicrm","id":136373,"avatar_url":"https://avatars.githubusercontent.com/u/136373?v=3","gravatar_id":"","url":"https://api.github.com/users/civicrm","html_url":"https://github.com/civicrm","followers_url":"https://api.github.com/users/civicrm/followers","following_url":"https://api.github.com/users/civicrm/following{/other_user}","gists_url":"https://api.github.com/users/civicrm/gists{/gist_id}","starred_url":"https://api.github.com/users/civicrm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/civicrm/subscriptions","organizations_url":"https://api.github.com/users/civicrm/orgs","repos_url":"https://api.github.com/users/civicrm/repos","events_url":"https://api.github.com/users/civicrm/events{/privacy}","received_events_url":"https://api.github.com/users/civicrm/received_events","type":"Organization","site_admin":false},"repo":{"id":10086903,"name":"civihr","full_name":"civicrm/civihr","owner":{"login":"civicrm","id":136373,"avatar_url":"https://avatars.githubusercontent.com/u/136373?v=3","gravatar_id":"","url":"https://api.github.com/users/civicrm","html_url":"https://github.com/civicrm","followers_url":"https://api.github.com/users/civicrm/followers","following_url":"https://api.github.com/users/civicrm/following{/other_user}","gists_url":"https://api.github.com/users/civicrm/gists{/gist_id}","starred_url":"https://api.github.com/users/civicrm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/civicrm/subscriptions","organizations_url":"https://api.github.com/users/civicrm/orgs","repos_url":"https://api.github.com/users/civicrm/repos","events_url":"https://api.github.com/users/civicrm/events{/privacy}","received_events_url":"https://api.github.com/users/civicrm/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/civicrm/civihr","description":"CiviHR","fork":false,"url":"https://api.github.com/repos/civicrm/civihr","forks_url":"https://api.github.com/repos/civicrm/civihr/forks","keys_url":"https://api.github.com/repos/civicrm/civihr/keys{/key_id}","collaborators_url":"https://api.github.com/repos/civicrm/civihr/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/civicrm/civihr/teams","hooks_url":"https://api.github.com/repos/civicrm/civihr/hooks","issue_events_url":"https://api.github.com/repos/civicrm/civihr/issues/events{/number}","events_url":"https://api.github.com/repos/civicrm/civihr/events","assignees_url":"https://api.github.com/repos/civicrm/civihr/assignees{/user}","branches_url":"https://api.github.com/repos/civicrm/civihr/branches{/branch}","tags_url":"https://api.github.com/repos/civicrm/civihr/tags","blobs_url":"https://api.github.com/repos/civicrm/civihr/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/civicrm/civihr/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/civicrm/civihr/git/refs{/sha}","trees_url":"https://api.github.com/repos/civicrm/civihr/git/trees{/sha}","statuses_url":"https://api.github.com/repos/civicrm/civihr/statuses/{sha}","languages_url":"https://api.github.com/repos/civicrm/civihr/languages","stargazers_url":"https://api.github.com/repos/civicrm/civihr/stargazers","contributors_url":"https://api.github.com/repos/civicrm/civihr/contributors","subscribers_url":"https://api.github.com/repos/civicrm/civihr/subscribers","subscription_url":"https://api.github.com/repos/civicrm/civihr/subscription","commits_url":"https://api.github.com/repos/civicrm/civihr/commits{/sha}","git_commits_url":"https://api.github.com/repos/civicrm/civihr/git/commits{/sha}","comments_url":"https://api.github.com/repos/civicrm/civihr/comments{/number}","issue_comment_url":"https://api.github.com/repos/civicrm/civihr/issues/comments{/number}","contents_url":"https://api.github.com/repos/civicrm/civihr/contents/{+path}","compare_url":"https://api.github.com/repos/civicrm/civihr/compare/{base}...{head}","merges_url":"https://api.github.com/repos/civicrm/civihr/merges","archive_url":"https://api.github.com/repos/civicrm/civihr/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/civicrm/civihr/downloads","issues_url":"https://api.github.com/repos/civicrm/civihr/issues{/number}","pulls_url":"https://api.github.com/repos/civicrm/civihr/pulls{/number}","milestones_url":"https://api.github.com/repos/civicrm/civihr/milestones{/number}","notifications_url":"https://api.github.com/repos/civicrm/civihr/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/civicrm/civihr/labels{/name}","releases_url":"https://api.github.com/repos/civicrm/civihr/releases{/id}","deployments_url":"https://api.github.com/repos/civicrm/civihr/deployments","created_at":"2013-05-15T20:06:06Z","updated_at":"2016-04-18T10:23:15Z","pushed_at":"2016-05-03T20:29:32Z","git_url":"git://github.com/civicrm/civihr.git","ssh_url":"git@github.com:civicrm/civihr.git","clone_url":"https://github.com/civicrm/civihr.git","svn_url":"https://github.com/civicrm/civihr","homepage":null,"size":20605,"stargazers_count":3,"watchers_count":3,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":21,"mirror_url":null,"open_issues_count":4,"forks":21,"open_issues":4,"watchers":3,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/civicrm/civihr/pulls/920"},"html":{"href":"https://github.com/civicrm/civihr/pull/920"},"issue":{"href":"https://api.github.com/repos/civicrm/civihr/issues/920"},"comments":{"href":"https://api.github.com/repos/civicrm/civihr/issues/920/comments"},"review_comments":{"href":"https://api.github.com/repos/civicrm/civihr/pulls/920/comments"},"review_comment":{"href":"https://api.github.com/repos/civicrm/civihr/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/civicrm/civihr/pulls/920/commits"},"statuses":{"href":"https://api.github.com/repos/civicrm/civihr/statuses/ce621c0990dbb842c30bba94250f50b77351351e"}}}}