{"action":"created","comment":{"url":"https://api.github.com/repos/HTBox/allReady/pulls/comments/88781018","pull_request_review_id":9346806,"id":88781018,"diff_hunk":"@@ -1,68 +1,68 @@\n-﻿using System;\n-using System.Collections.Generic;\n-using System.Threading.Tasks;\n-using AllReady.Areas.Admin.ViewModels.Task;\n-using AllReady.Features.Events;\n-using AllReady.Models;\n-using AllReady.Providers;\n-using MediatR;\n-\n-namespace AllReady.Areas.Admin.ViewModels.Validators.Task\n-{\n-    public class TaskEditViewModelValidator : ITaskEditViewModelValidator\n-    {\n-        private readonly IMediator _mediator;\n-\n-        public TaskEditViewModelValidator(IMediator mediator)\n-        {\n-            if (mediator == null)\n-            {\n-                throw new ArgumentNullException(nameof(mediator));\n-            }\n-\n-            _mediator = mediator;\n-        }\n-\n-        public async Task<List<KeyValuePair<string, string>>> Validate(EditViewModel viewModel)\n-        {\n-            var result = new List<KeyValuePair<string, string>>();\n-\n+﻿using System;\r\n+using System.Collections.Generic;\r\n+using System.Threading.Tasks;\r\n+using AllReady.Areas.Admin.ViewModels.Task;\r\n+using AllReady.Features.Events;\r\n+using AllReady.Models;\r\n+using AllReady.Providers;\r\n+using MediatR;\r\n+\r\n+namespace AllReady.Areas.Admin.ViewModels.Validators.Task\r\n+{\r\n+    public class TaskEditViewModelValidator : ITaskEditViewModelValidator\r\n+    {\r\n+        private readonly IMediator _mediator;\r\n+\r\n+        public TaskEditViewModelValidator(IMediator mediator)\r\n+        {\r\n+            if (mediator == null)\r\n+            {\r\n+                throw new ArgumentNullException(nameof(mediator));\r\n+            }\r\n+\r\n+            _mediator = mediator;\r\n+        }\r\n+\r\n+        public async Task<List<KeyValuePair<string, string>>> Validate(EditViewModel viewModel)\r\n+        {\r\n+            var result = new List<KeyValuePair<string, string>>();\r\n+\r\n             var parentEvent = await _mediator.SendAsync(new EventByEventIdQuery { EventId = viewModel.EventId });\r\n-\n-\n-            // Rule - End date cannot be earlier than start date\n-            if (viewModel.EndDateTime < viewModel.StartDateTime)\n-            {\n-                result.Add(new KeyValuePair<string, string>(nameof(viewModel.EndDateTime), \"End date cannot be earlier than the start date\"));\n-            }\n-\n-            // Rule - Start date cannot be out of range of parent event\n-            if (viewModel.StartDateTime < parentEvent.StartDateTime)\n-            {\n-                result.Add(new KeyValuePair<string, string>(nameof(viewModel.StartDateTime), \"Start date cannot be earlier than the event start date \" + parentEvent.StartDateTime.ToString(\"d\")));\n-            }\n-\n-            // Rule - End date cannot be out of range of parent event\n-            if (viewModel.EndDateTime > parentEvent.EndDateTime)\n-            {\n-                result.Add(new KeyValuePair<string, string>(nameof(viewModel.EndDateTime), \"End date cannot be later than the event end date \" + parentEvent.EndDateTime.ToString(\"d\")));\n-            }\n-\n-            // Rule - Itinerary tasks must start and end on same calendar day\n-            if (parentEvent.EventType == EventType.Itinerary)\n-            {\n-                if (viewModel.StartDateTime.Date != viewModel.EndDateTime.Date)\n-                {\n-                    result.Add(new KeyValuePair<string, string>(nameof(viewModel.EndDateTime), \"For itinerary events the task end date must occur on the same day as the start date. Tasks cannot span multiple days\"));\n-                }\n-            }\n-\n-            return result;\n-        }\n-    }\n-\n-    public interface ITaskEditViewModelValidator\n-    {\n+\r\n+\r\n+            // Rule - End date cannot be earlier than start date\r\n+            if (viewModel.EndDateTime < viewModel.StartDateTime)\r\n+            {\r\n+                result.Add(new KeyValuePair<string, string>(nameof(viewModel.EndDateTime), \"End date cannot be earlier than the start date\"));\r\n+            }\r\n+\r\n+            // Rule - Start date cannot be out of range of parent event\r\n+            if (viewModel.StartDateTime < parentEvent.StartDateTime)\r\n+            {\r\n+                result.Add(new KeyValuePair<string, string>(nameof(viewModel.StartDateTime), \"Start date cannot be earlier than the event start date \" + parentEvent.StartDateTime.ToString(\"f\")));\r","path":"AllReadyApp/Web-App/AllReady/Areas/Admin/ViewModels/Validators/Task/TaskEditViewModelValidator.cs","position":106,"original_position":106,"commit_id":"f0dc61d1cba2ea91826c8f438e76eff5cde76094","original_commit_id":"f0dc61d1cba2ea91826c8f438e76eff5cde76094","user":{"login":"dpaquette","id":2531875,"avatar_url":"https://avatars.githubusercontent.com/u/2531875?v=3","gravatar_id":"","url":"https://api.github.com/users/dpaquette","html_url":"https://github.com/dpaquette","followers_url":"https://api.github.com/users/dpaquette/followers","following_url":"https://api.github.com/users/dpaquette/following{/other_user}","gists_url":"https://api.github.com/users/dpaquette/gists{/gist_id}","starred_url":"https://api.github.com/users/dpaquette/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dpaquette/subscriptions","organizations_url":"https://api.github.com/users/dpaquette/orgs","repos_url":"https://api.github.com/users/dpaquette/repos","events_url":"https://api.github.com/users/dpaquette/events{/privacy}","received_events_url":"https://api.github.com/users/dpaquette/received_events","type":"User","site_admin":false},"body":"We have typically been using \"g\" as the date/time pattern.\r\nAlso prefer using string.Format or string interpolation instead of concatenating strings. for example:\r\n$\"Start date cannot be earlier than the event start date {parentEvent.StartDateTime.ToString(\"g\")}\" \r\n","created_at":"2016-11-19T15:04:22Z","updated_at":"2016-11-19T15:04:22Z","html_url":"https://github.com/HTBox/allReady/pull/1536#discussion_r88781018","pull_request_url":"https://api.github.com/repos/HTBox/allReady/pulls/1536","_links":{"self":{"href":"https://api.github.com/repos/HTBox/allReady/pulls/comments/88781018"},"html":{"href":"https://github.com/HTBox/allReady/pull/1536#discussion_r88781018"},"pull_request":{"href":"https://api.github.com/repos/HTBox/allReady/pulls/1536"}}},"pull_request":{"url":"https://api.github.com/repos/HTBox/allReady/pulls/1536","id":94484077,"html_url":"https://github.com/HTBox/allReady/pull/1536","diff_url":"https://github.com/HTBox/allReady/pull/1536.diff","patch_url":"https://github.com/HTBox/allReady/pull/1536.patch","issue_url":"https://api.github.com/repos/HTBox/allReady/issues/1536","number":1536,"state":"open","locked":false,"title":"Issue branch 1517","user":{"login":"rkiggen","id":6376601,"avatar_url":"https://avatars.githubusercontent.com/u/6376601?v=3","gravatar_id":"","url":"https://api.github.com/users/rkiggen","html_url":"https://github.com/rkiggen","followers_url":"https://api.github.com/users/rkiggen/followers","following_url":"https://api.github.com/users/rkiggen/following{/other_user}","gists_url":"https://api.github.com/users/rkiggen/gists{/gist_id}","starred_url":"https://api.github.com/users/rkiggen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rkiggen/subscriptions","organizations_url":"https://api.github.com/users/rkiggen/orgs","repos_url":"https://api.github.com/users/rkiggen/repos","events_url":"https://api.github.com/users/rkiggen/events{/privacy}","received_events_url":"https://api.github.com/users/rkiggen/received_events","type":"User","site_admin":false},"body":"Changed validation message for the end date validation of a task\r\nCloses #1517 ","created_at":"2016-11-19T14:58:27Z","updated_at":"2016-11-19T15:04:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"63382c7b9eb0e8d407d9586120df8905004537ce","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/HTBox/allReady/pulls/1536/commits","review_comments_url":"https://api.github.com/repos/HTBox/allReady/pulls/1536/comments","review_comment_url":"https://api.github.com/repos/HTBox/allReady/pulls/comments{/number}","comments_url":"https://api.github.com/repos/HTBox/allReady/issues/1536/comments","statuses_url":"https://api.github.com/repos/HTBox/allReady/statuses/f0dc61d1cba2ea91826c8f438e76eff5cde76094","head":{"label":"rkiggen:issue-branch-1517","ref":"issue-branch-1517","sha":"f0dc61d1cba2ea91826c8f438e76eff5cde76094","user":{"login":"rkiggen","id":6376601,"avatar_url":"https://avatars.githubusercontent.com/u/6376601?v=3","gravatar_id":"","url":"https://api.github.com/users/rkiggen","html_url":"https://github.com/rkiggen","followers_url":"https://api.github.com/users/rkiggen/followers","following_url":"https://api.github.com/users/rkiggen/following{/other_user}","gists_url":"https://api.github.com/users/rkiggen/gists{/gist_id}","starred_url":"https://api.github.com/users/rkiggen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rkiggen/subscriptions","organizations_url":"https://api.github.com/users/rkiggen/orgs","repos_url":"https://api.github.com/users/rkiggen/repos","events_url":"https://api.github.com/users/rkiggen/events{/privacy}","received_events_url":"https://api.github.com/users/rkiggen/received_events","type":"User","site_admin":false},"repo":{"id":74208244,"name":"allReady","full_name":"rkiggen/allReady","owner":{"login":"rkiggen","id":6376601,"avatar_url":"https://avatars.githubusercontent.com/u/6376601?v=3","gravatar_id":"","url":"https://api.github.com/users/rkiggen","html_url":"https://github.com/rkiggen","followers_url":"https://api.github.com/users/rkiggen/followers","following_url":"https://api.github.com/users/rkiggen/following{/other_user}","gists_url":"https://api.github.com/users/rkiggen/gists{/gist_id}","starred_url":"https://api.github.com/users/rkiggen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rkiggen/subscriptions","organizations_url":"https://api.github.com/users/rkiggen/orgs","repos_url":"https://api.github.com/users/rkiggen/repos","events_url":"https://api.github.com/users/rkiggen/events{/privacy}","received_events_url":"https://api.github.com/users/rkiggen/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rkiggen/allReady","description":"This repo contains the code for allReady, an open-source solution focused on increasing awareness, efficiency and impact of preparedness campaigns as they are delivered by humanitarian and disaster response organizations in local communities.","fork":true,"url":"https://api.github.com/repos/rkiggen/allReady","forks_url":"https://api.github.com/repos/rkiggen/allReady/forks","keys_url":"https://api.github.com/repos/rkiggen/allReady/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rkiggen/allReady/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rkiggen/allReady/teams","hooks_url":"https://api.github.com/repos/rkiggen/allReady/hooks","issue_events_url":"https://api.github.com/repos/rkiggen/allReady/issues/events{/number}","events_url":"https://api.github.com/repos/rkiggen/allReady/events","assignees_url":"https://api.github.com/repos/rkiggen/allReady/assignees{/user}","branches_url":"https://api.github.com/repos/rkiggen/allReady/branches{/branch}","tags_url":"https://api.github.com/repos/rkiggen/allReady/tags","blobs_url":"https://api.github.com/repos/rkiggen/allReady/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rkiggen/allReady/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rkiggen/allReady/git/refs{/sha}","trees_url":"https://api.github.com/repos/rkiggen/allReady/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rkiggen/allReady/statuses/{sha}","languages_url":"https://api.github.com/repos/rkiggen/allReady/languages","stargazers_url":"https://api.github.com/repos/rkiggen/allReady/stargazers","contributors_url":"https://api.github.com/repos/rkiggen/allReady/contributors","subscribers_url":"https://api.github.com/repos/rkiggen/allReady/subscribers","subscription_url":"https://api.github.com/repos/rkiggen/allReady/subscription","commits_url":"https://api.github.com/repos/rkiggen/allReady/commits{/sha}","git_commits_url":"https://api.github.com/repos/rkiggen/allReady/git/commits{/sha}","comments_url":"https://api.github.com/repos/rkiggen/allReady/comments{/number}","issue_comment_url":"https://api.github.com/repos/rkiggen/allReady/issues/comments{/number}","contents_url":"https://api.github.com/repos/rkiggen/allReady/contents/{+path}","compare_url":"https://api.github.com/repos/rkiggen/allReady/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rkiggen/allReady/merges","archive_url":"https://api.github.com/repos/rkiggen/allReady/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rkiggen/allReady/downloads","issues_url":"https://api.github.com/repos/rkiggen/allReady/issues{/number}","pulls_url":"https://api.github.com/repos/rkiggen/allReady/pulls{/number}","milestones_url":"https://api.github.com/repos/rkiggen/allReady/milestones{/number}","notifications_url":"https://api.github.com/repos/rkiggen/allReady/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rkiggen/allReady/labels{/name}","releases_url":"https://api.github.com/repos/rkiggen/allReady/releases{/id}","deployments_url":"https://api.github.com/repos/rkiggen/allReady/deployments","created_at":"2016-11-19T12:50:21Z","updated_at":"2016-11-19T12:50:23Z","pushed_at":"2016-11-19T14:51:13Z","git_url":"git://github.com/rkiggen/allReady.git","ssh_url":"git@github.com:rkiggen/allReady.git","clone_url":"https://github.com/rkiggen/allReady.git","svn_url":"https://github.com/rkiggen/allReady","homepage":"http://www.htbox.org/projects/allready","size":30694,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"HTBox:master","ref":"master","sha":"bc2c8dcc30cd84051260dc1febe00b6c9565bb71","user":{"login":"HTBox","id":5184596,"avatar_url":"https://avatars.githubusercontent.com/u/5184596?v=3","gravatar_id":"","url":"https://api.github.com/users/HTBox","html_url":"https://github.com/HTBox","followers_url":"https://api.github.com/users/HTBox/followers","following_url":"https://api.github.com/users/HTBox/following{/other_user}","gists_url":"https://api.github.com/users/HTBox/gists{/gist_id}","starred_url":"https://api.github.com/users/HTBox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HTBox/subscriptions","organizations_url":"https://api.github.com/users/HTBox/orgs","repos_url":"https://api.github.com/users/HTBox/repos","events_url":"https://api.github.com/users/HTBox/events{/privacy}","received_events_url":"https://api.github.com/users/HTBox/received_events","type":"Organization","site_admin":false},"repo":{"id":39270253,"name":"allReady","full_name":"HTBox/allReady","owner":{"login":"HTBox","id":5184596,"avatar_url":"https://avatars.githubusercontent.com/u/5184596?v=3","gravatar_id":"","url":"https://api.github.com/users/HTBox","html_url":"https://github.com/HTBox","followers_url":"https://api.github.com/users/HTBox/followers","following_url":"https://api.github.com/users/HTBox/following{/other_user}","gists_url":"https://api.github.com/users/HTBox/gists{/gist_id}","starred_url":"https://api.github.com/users/HTBox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HTBox/subscriptions","organizations_url":"https://api.github.com/users/HTBox/orgs","repos_url":"https://api.github.com/users/HTBox/repos","events_url":"https://api.github.com/users/HTBox/events{/privacy}","received_events_url":"https://api.github.com/users/HTBox/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/HTBox/allReady","description":"This repo contains the code for allReady, an open-source solution focused on increasing awareness, efficiency and impact of preparedness campaigns as they are delivered by humanitarian and disaster response organizations in local communities.","fork":false,"url":"https://api.github.com/repos/HTBox/allReady","forks_url":"https://api.github.com/repos/HTBox/allReady/forks","keys_url":"https://api.github.com/repos/HTBox/allReady/keys{/key_id}","collaborators_url":"https://api.github.com/repos/HTBox/allReady/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/HTBox/allReady/teams","hooks_url":"https://api.github.com/repos/HTBox/allReady/hooks","issue_events_url":"https://api.github.com/repos/HTBox/allReady/issues/events{/number}","events_url":"https://api.github.com/repos/HTBox/allReady/events","assignees_url":"https://api.github.com/repos/HTBox/allReady/assignees{/user}","branches_url":"https://api.github.com/repos/HTBox/allReady/branches{/branch}","tags_url":"https://api.github.com/repos/HTBox/allReady/tags","blobs_url":"https://api.github.com/repos/HTBox/allReady/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/HTBox/allReady/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/HTBox/allReady/git/refs{/sha}","trees_url":"https://api.github.com/repos/HTBox/allReady/git/trees{/sha}","statuses_url":"https://api.github.com/repos/HTBox/allReady/statuses/{sha}","languages_url":"https://api.github.com/repos/HTBox/allReady/languages","stargazers_url":"https://api.github.com/repos/HTBox/allReady/stargazers","contributors_url":"https://api.github.com/repos/HTBox/allReady/contributors","subscribers_url":"https://api.github.com/repos/HTBox/allReady/subscribers","subscription_url":"https://api.github.com/repos/HTBox/allReady/subscription","commits_url":"https://api.github.com/repos/HTBox/allReady/commits{/sha}","git_commits_url":"https://api.github.com/repos/HTBox/allReady/git/commits{/sha}","comments_url":"https://api.github.com/repos/HTBox/allReady/comments{/number}","issue_comment_url":"https://api.github.com/repos/HTBox/allReady/issues/comments{/number}","contents_url":"https://api.github.com/repos/HTBox/allReady/contents/{+path}","compare_url":"https://api.github.com/repos/HTBox/allReady/compare/{base}...{head}","merges_url":"https://api.github.com/repos/HTBox/allReady/merges","archive_url":"https://api.github.com/repos/HTBox/allReady/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/HTBox/allReady/downloads","issues_url":"https://api.github.com/repos/HTBox/allReady/issues{/number}","pulls_url":"https://api.github.com/repos/HTBox/allReady/pulls{/number}","milestones_url":"https://api.github.com/repos/HTBox/allReady/milestones{/number}","notifications_url":"https://api.github.com/repos/HTBox/allReady/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/HTBox/allReady/labels{/name}","releases_url":"https://api.github.com/repos/HTBox/allReady/releases{/id}","deployments_url":"https://api.github.com/repos/HTBox/allReady/deployments","created_at":"2015-07-17T18:51:45Z","updated_at":"2016-11-17T23:57:09Z","pushed_at":"2016-11-19T14:58:27Z","git_url":"git://github.com/HTBox/allReady.git","ssh_url":"git@github.com:HTBox/allReady.git","clone_url":"https://github.com/HTBox/allReady.git","svn_url":"https://github.com/HTBox/allReady","homepage":"http://www.htbox.org/projects/allready","size":30735,"stargazers_count":454,"watchers_count":454,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":337,"mirror_url":null,"open_issues_count":210,"forks":337,"open_issues":210,"watchers":454,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/HTBox/allReady/pulls/1536"},"html":{"href":"https://github.com/HTBox/allReady/pull/1536"},"issue":{"href":"https://api.github.com/repos/HTBox/allReady/issues/1536"},"comments":{"href":"https://api.github.com/repos/HTBox/allReady/issues/1536/comments"},"review_comments":{"href":"https://api.github.com/repos/HTBox/allReady/pulls/1536/comments"},"review_comment":{"href":"https://api.github.com/repos/HTBox/allReady/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/HTBox/allReady/pulls/1536/commits"},"statuses":{"href":"https://api.github.com/repos/HTBox/allReady/statuses/f0dc61d1cba2ea91826c8f438e76eff5cde76094"}}}}
{"actor":{"display_login":"dpaquette"}}