{"action":"created","comment":{"url":"https://api.github.com/repos/privat/nit/pulls/comments/29784749","id":29784749,"diff_hunk":"@@ -0,0 +1,254 @@\n+# This file is part of NIT ( http://www.nitlanguage.org ).\n+#\n+# Licensed under the Apache License, Version 2.0 (the \"License\");\n+# you may not use this file except in compliance with the License.\n+# You may obtain a copy of the License at\n+#\n+#     http://www.apache.org/licenses/LICENSE-2.0\n+#\n+# Unless required by applicable law or agreed to in writing, software\n+# distributed under the License is distributed on an \"AS IS\" BASIS,\n+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+# See the License for the specific language governing permissions and\n+# limitations under the License.\n+\n+# Date and Time manipulation\n+# The class Date hase the basic opperation to use only the date data\n+# The class Time hase the basic opperation to use only the time data\n+# The class DateTime extend the class Date and Time to use the two of date and time data\n+#\n+# \tvar p_date = new Date.set(2014, 01, 09)\n+#\tvar auto_date = new Date.today ==> set the current date \n+#\tvar auto_time = new Time.now ==> set the current time\n+#\tvar date_time = new DateTime.today ==> set the current date and time\n+#\n+#\t#################\n+#\t#Some opperation#\n+#\t#################\n+#\n+#\t#DateTime:\n+#\tvar date_1  = new DateTime.time(2014, 02, 09, 13, 50, 0)\n+#\tvar date_2  = new DateTime.time(2014, 02, 09, 13, 51, 0)\n+#\t\n+#\tdate_1 > date_2 ==> return false\n+# \t\n+#\t#Date:\n+#\tvar date_1 = new Date.set(2014, 01, 12)\n+#\tvar date_2 = new Date.set(2014, 01, 30)\n+#\t\n+#\tdate_1.diff_month(date_2) ==> retrun 0\n+#\n+#\t#Time:\n+#\tvar time_1 = new Time.now\n+#\tvar time_2 = new Time.set(14,25,30)\n+#\t\n+#\ttime_1 == time_2\n+#\n+module date\n+\n+# The class \"Time\" allow the manipulation only on the time data\n+class Time\n+\tsuper Comparable\n+\n+\t# Hours as an integer\n+\tvar hours: Int = 0\n+\n+\t# Minutes as an integer\n+\tvar minutes: Int = 0\n+\n+\t# Secounds as an integer\n+\tvar sec: Int = 0\n+\n+\t# the set the time\n+\tinit set(h, m, s: Int)do\n+\t\thours = h\n+\t\tminutes = m\n+\t\tsec = s\n+\tend\n+\n+\t#this will initialized the current time\n+\tinit now do\n+\t\tvar tm = new Tm.localtime\n+\t\thours = tm.hour\n+\t\tminutes = tm.min\n+\t\tsec = tm.sec\n+\tend\n+\n+\tredef fun ==(d)  \n+\tdo\n+\t\tif d isa Time then \n+\t\t\treturn time_eq(d)\n+\t\tend\n+\t\treturn false\n+\tend\n+\n+\t# this check if the time is eq or not\n+\tfun time_eq(d: Time): Bool\n+\tdo\n+\t\tif (hours * 3600 + minutes * 60 + sec) != (d.hours * 3600 + d.minutes * 60 + d.sec) then\n+\t\t\treturn false\n+\t\tend\n+\t\treturn true\n+\tend\n+end\n+\n+# The class \"DateTime\" allow the manipulation of date and time data\n+class DateTime\n+\tsuper Date\n+\tsuper Time\n+\n+\t# for set the time (hours, min, sec) \n+\tinit time(y, mth, d, h, m, s: Int) do\n+\t\tyear = y\n+\t\tmonth = mth\n+\t\tdays = d\n+\t\thours = h\n+\t\tminutes = m\n+\t\tsec = s\n+\tend\n+\n+\tredef init today do\n+\t\tsuper\n+\t\tvar tm = new Tm.localtime\n+\t\thours = tm.hour\n+\t\tminutes = tm.min\n+\t\tsec = tm.sec\n+\tend\n+\n+\tredef fun ==(d)  \n+\tdo\n+\t\tif d isa DateTime and self.diff_days(d) == 0 then \n+\t\t\treturn time_eq(d)\n+\t\tend\n+\t\treturn false\n+\tend\n+\n+\tredef fun to_s do\n+\t\tsuper\n+\t\treturn date_s + \" {hours.to_s}:{minutes.to_s}:{sec.to_s}{time_zone}\"\n+\tend\n+end\n+\n+# The class \"Date\" allow the manipulation only on the date data\n+class Date\n+\tsuper Comparable\n+\n+\t# Years as an integer ex: 1989\n+\tvar year: Int = 0\n+\n+\t# Months as an integer ex: \"3\" for March\n+\tvar month: Int = 0\n+\n+\t# Days as an integer \n+\tvar days: Int = 0","path":"lib/date.nit","position":143,"original_position":143,"commit_id":"0c80697ba3ccbcb2baa9acf5764e524ec5623bd0","original_commit_id":"611d21ed5f61986dd53eec0f23cc595f35851c3f","user":{"login":"Morriar","id":583144,"avatar_url":"https://avatars.githubusercontent.com/u/583144?v=3","gravatar_id":"","url":"https://api.github.com/users/Morriar","html_url":"https://github.com/Morriar","followers_url":"https://api.github.com/users/Morriar/followers","following_url":"https://api.github.com/users/Morriar/following{/other_user}","gists_url":"https://api.github.com/users/Morriar/gists{/gist_id}","starred_url":"https://api.github.com/users/Morriar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Morriar/subscriptions","organizations_url":"https://api.github.com/users/Morriar/orgs","repos_url":"https://api.github.com/users/Morriar/repos","events_url":"https://api.github.com/users/Morriar/events{/privacy}","received_events_url":"https://api.github.com/users/Morriar/received_events","type":"User","site_admin":false},"body":"Plus, please be consistent with the singular/plural form used in `Time`.","created_at":"2015-05-06T18:04:00Z","updated_at":"2015-05-06T18:04:00Z","html_url":"https://github.com/privat/nit/pull/1100#discussion_r29784749","pull_request_url":"https://api.github.com/repos/privat/nit/pulls/1100","_links":{"self":{"href":"https://api.github.com/repos/privat/nit/pulls/comments/29784749"},"html":{"href":"https://github.com/privat/nit/pull/1100#discussion_r29784749"},"pull_request":{"href":"https://api.github.com/repos/privat/nit/pulls/1100"}}},"pull_request":{"url":"https://api.github.com/repos/privat/nit/pulls/1100","id":27279827,"html_url":"https://github.com/privat/nit/pull/1100","diff_url":"https://github.com/privat/nit/pull/1100.diff","patch_url":"https://github.com/privat/nit/pull/1100.patch","issue_url":"https://api.github.com/repos/privat/nit/issues/1100","number":1100,"state":"open","locked":false,"title":"Date Lib","user":{"login":"MehdiAit","id":3407293,"avatar_url":"https://avatars.githubusercontent.com/u/3407293?v=3","gravatar_id":"","url":"https://api.github.com/users/MehdiAit","html_url":"https://github.com/MehdiAit","followers_url":"https://api.github.com/users/MehdiAit/followers","following_url":"https://api.github.com/users/MehdiAit/following{/other_user}","gists_url":"https://api.github.com/users/MehdiAit/gists{/gist_id}","starred_url":"https://api.github.com/users/MehdiAit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MehdiAit/subscriptions","organizations_url":"https://api.github.com/users/MehdiAit/orgs","repos_url":"https://api.github.com/users/MehdiAit/repos","events_url":"https://api.github.com/users/MehdiAit/events{/privacy}","received_events_url":"https://api.github.com/users/MehdiAit/received_events","type":"User","site_admin":false},"body":"les fonctions ce trouve dans le module date_f.nit.","created_at":"2015-01-13T15:40:50Z","updated_at":"2015-05-06T18:04:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2e763f640428e81d0dd1bdacf047ca94d4870e1a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/privat/nit/pulls/1100/commits","review_comments_url":"https://api.github.com/repos/privat/nit/pulls/1100/comments","review_comment_url":"https://api.github.com/repos/privat/nit/pulls/comments{/number}","comments_url":"https://api.github.com/repos/privat/nit/issues/1100/comments","statuses_url":"https://api.github.com/repos/privat/nit/statuses/0c80697ba3ccbcb2baa9acf5764e524ec5623bd0","head":{"label":"MehdiAit:master","ref":"master","sha":"0c80697ba3ccbcb2baa9acf5764e524ec5623bd0","user":{"login":"MehdiAit","id":3407293,"avatar_url":"https://avatars.githubusercontent.com/u/3407293?v=3","gravatar_id":"","url":"https://api.github.com/users/MehdiAit","html_url":"https://github.com/MehdiAit","followers_url":"https://api.github.com/users/MehdiAit/followers","following_url":"https://api.github.com/users/MehdiAit/following{/other_user}","gists_url":"https://api.github.com/users/MehdiAit/gists{/gist_id}","starred_url":"https://api.github.com/users/MehdiAit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MehdiAit/subscriptions","organizations_url":"https://api.github.com/users/MehdiAit/orgs","repos_url":"https://api.github.com/users/MehdiAit/repos","events_url":"https://api.github.com/users/MehdiAit/events{/privacy}","received_events_url":"https://api.github.com/users/MehdiAit/received_events","type":"User","site_admin":false},"repo":{"id":29065535,"name":"nit","full_name":"MehdiAit/nit","owner":{"login":"MehdiAit","id":3407293,"avatar_url":"https://avatars.githubusercontent.com/u/3407293?v=3","gravatar_id":"","url":"https://api.github.com/users/MehdiAit","html_url":"https://github.com/MehdiAit","followers_url":"https://api.github.com/users/MehdiAit/followers","following_url":"https://api.github.com/users/MehdiAit/following{/other_user}","gists_url":"https://api.github.com/users/MehdiAit/gists{/gist_id}","starred_url":"https://api.github.com/users/MehdiAit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MehdiAit/subscriptions","organizations_url":"https://api.github.com/users/MehdiAit/orgs","repos_url":"https://api.github.com/users/MehdiAit/repos","events_url":"https://api.github.com/users/MehdiAit/events{/privacy}","received_events_url":"https://api.github.com/users/MehdiAit/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/MehdiAit/nit","description":"Nit language","fork":true,"url":"https://api.github.com/repos/MehdiAit/nit","forks_url":"https://api.github.com/repos/MehdiAit/nit/forks","keys_url":"https://api.github.com/repos/MehdiAit/nit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MehdiAit/nit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MehdiAit/nit/teams","hooks_url":"https://api.github.com/repos/MehdiAit/nit/hooks","issue_events_url":"https://api.github.com/repos/MehdiAit/nit/issues/events{/number}","events_url":"https://api.github.com/repos/MehdiAit/nit/events","assignees_url":"https://api.github.com/repos/MehdiAit/nit/assignees{/user}","branches_url":"https://api.github.com/repos/MehdiAit/nit/branches{/branch}","tags_url":"https://api.github.com/repos/MehdiAit/nit/tags","blobs_url":"https://api.github.com/repos/MehdiAit/nit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MehdiAit/nit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MehdiAit/nit/git/refs{/sha}","trees_url":"https://api.github.com/repos/MehdiAit/nit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MehdiAit/nit/statuses/{sha}","languages_url":"https://api.github.com/repos/MehdiAit/nit/languages","stargazers_url":"https://api.github.com/repos/MehdiAit/nit/stargazers","contributors_url":"https://api.github.com/repos/MehdiAit/nit/contributors","subscribers_url":"https://api.github.com/repos/MehdiAit/nit/subscribers","subscription_url":"https://api.github.com/repos/MehdiAit/nit/subscription","commits_url":"https://api.github.com/repos/MehdiAit/nit/commits{/sha}","git_commits_url":"https://api.github.com/repos/MehdiAit/nit/git/commits{/sha}","comments_url":"https://api.github.com/repos/MehdiAit/nit/comments{/number}","issue_comment_url":"https://api.github.com/repos/MehdiAit/nit/issues/comments{/number}","contents_url":"https://api.github.com/repos/MehdiAit/nit/contents/{+path}","compare_url":"https://api.github.com/repos/MehdiAit/nit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MehdiAit/nit/merges","archive_url":"https://api.github.com/repos/MehdiAit/nit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MehdiAit/nit/downloads","issues_url":"https://api.github.com/repos/MehdiAit/nit/issues{/number}","pulls_url":"https://api.github.com/repos/MehdiAit/nit/pulls{/number}","milestones_url":"https://api.github.com/repos/MehdiAit/nit/milestones{/number}","notifications_url":"https://api.github.com/repos/MehdiAit/nit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MehdiAit/nit/labels{/name}","releases_url":"https://api.github.com/repos/MehdiAit/nit/releases{/id}","created_at":"2015-01-10T17:51:56Z","updated_at":"2015-05-06T13:59:28Z","pushed_at":"2015-05-06T13:59:28Z","git_url":"git://github.com/MehdiAit/nit.git","ssh_url":"git@github.com:MehdiAit/nit.git","clone_url":"https://github.com/MehdiAit/nit.git","svn_url":"https://github.com/MehdiAit/nit","homepage":"http://nitlanguage.org","size":55281,"stargazers_count":1,"watchers_count":1,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"privat:master","ref":"master","sha":"ace6ea4a957ca05aa6ace7e928973b6a158ae74c","user":{"login":"privat","id":135828,"avatar_url":"https://avatars.githubusercontent.com/u/135828?v=3","gravatar_id":"","url":"https://api.github.com/users/privat","html_url":"https://github.com/privat","followers_url":"https://api.github.com/users/privat/followers","following_url":"https://api.github.com/users/privat/following{/other_user}","gists_url":"https://api.github.com/users/privat/gists{/gist_id}","starred_url":"https://api.github.com/users/privat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/privat/subscriptions","organizations_url":"https://api.github.com/users/privat/orgs","repos_url":"https://api.github.com/users/privat/repos","events_url":"https://api.github.com/users/privat/events{/privacy}","received_events_url":"https://api.github.com/users/privat/received_events","type":"User","site_admin":false},"repo":{"id":328597,"name":"nit","full_name":"privat/nit","owner":{"login":"privat","id":135828,"avatar_url":"https://avatars.githubusercontent.com/u/135828?v=3","gravatar_id":"","url":"https://api.github.com/users/privat","html_url":"https://github.com/privat","followers_url":"https://api.github.com/users/privat/followers","following_url":"https://api.github.com/users/privat/following{/other_user}","gists_url":"https://api.github.com/users/privat/gists{/gist_id}","starred_url":"https://api.github.com/users/privat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/privat/subscriptions","organizations_url":"https://api.github.com/users/privat/orgs","repos_url":"https://api.github.com/users/privat/repos","events_url":"https://api.github.com/users/privat/events{/privacy}","received_events_url":"https://api.github.com/users/privat/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/privat/nit","description":"Nit language","fork":false,"url":"https://api.github.com/repos/privat/nit","forks_url":"https://api.github.com/repos/privat/nit/forks","keys_url":"https://api.github.com/repos/privat/nit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/privat/nit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/privat/nit/teams","hooks_url":"https://api.github.com/repos/privat/nit/hooks","issue_events_url":"https://api.github.com/repos/privat/nit/issues/events{/number}","events_url":"https://api.github.com/repos/privat/nit/events","assignees_url":"https://api.github.com/repos/privat/nit/assignees{/user}","branches_url":"https://api.github.com/repos/privat/nit/branches{/branch}","tags_url":"https://api.github.com/repos/privat/nit/tags","blobs_url":"https://api.github.com/repos/privat/nit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/privat/nit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/privat/nit/git/refs{/sha}","trees_url":"https://api.github.com/repos/privat/nit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/privat/nit/statuses/{sha}","languages_url":"https://api.github.com/repos/privat/nit/languages","stargazers_url":"https://api.github.com/repos/privat/nit/stargazers","contributors_url":"https://api.github.com/repos/privat/nit/contributors","subscribers_url":"https://api.github.com/repos/privat/nit/subscribers","subscription_url":"https://api.github.com/repos/privat/nit/subscription","commits_url":"https://api.github.com/repos/privat/nit/commits{/sha}","git_commits_url":"https://api.github.com/repos/privat/nit/git/commits{/sha}","comments_url":"https://api.github.com/repos/privat/nit/comments{/number}","issue_comment_url":"https://api.github.com/repos/privat/nit/issues/comments{/number}","contents_url":"https://api.github.com/repos/privat/nit/contents/{+path}","compare_url":"https://api.github.com/repos/privat/nit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/privat/nit/merges","archive_url":"https://api.github.com/repos/privat/nit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/privat/nit/downloads","issues_url":"https://api.github.com/repos/privat/nit/issues{/number}","pulls_url":"https://api.github.com/repos/privat/nit/pulls{/number}","milestones_url":"https://api.github.com/repos/privat/nit/milestones{/number}","notifications_url":"https://api.github.com/repos/privat/nit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/privat/nit/labels{/name}","releases_url":"https://api.github.com/repos/privat/nit/releases{/id}","created_at":"2009-10-06T15:03:00Z","updated_at":"2015-05-06T12:47:26Z","pushed_at":"2015-05-06T17:52:43Z","git_url":"git://github.com/privat/nit.git","ssh_url":"git@github.com:privat/nit.git","clone_url":"https://github.com/privat/nit.git","svn_url":"https://github.com/privat/nit","homepage":"http://nitlanguage.org","size":84346,"stargazers_count":65,"watchers_count":65,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":40,"mirror_url":null,"open_issues_count":111,"forks":40,"open_issues":111,"watchers":65,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/privat/nit/pulls/1100"},"html":{"href":"https://github.com/privat/nit/pull/1100"},"issue":{"href":"https://api.github.com/repos/privat/nit/issues/1100"},"comments":{"href":"https://api.github.com/repos/privat/nit/issues/1100/comments"},"review_comments":{"href":"https://api.github.com/repos/privat/nit/pulls/1100/comments"},"review_comment":{"href":"https://api.github.com/repos/privat/nit/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/privat/nit/pulls/1100/commits"},"statuses":{"href":"https://api.github.com/repos/privat/nit/statuses/0c80697ba3ccbcb2baa9acf5764e524ec5623bd0"}}}}