From 3cc7ca25ffbfc1ba45f54a06b4858184ef0e7a2c Mon Sep 17 00:00:00 2001 From: Sergey Zhigalov Date: Wed, 31 Oct 2012 17:38:21 +0600 Subject: [PATCH 1/2] =?UTF-8?q?=D0=A4=D1=83=D0=BD=D0=BA=D1=86=D0=B8=D1=8F?= =?UTF-8?q?=20=D0=BA=D0=BE=D1=82=D0=BE=D1=80=D0=B0=D1=8F=20=D1=81=D0=BE?= =?UTF-8?q?=D0=B7=D0=B4=D0=B0=D0=B5=D1=82=20=D1=81=D0=BE=D0=B1=D1=8B=D1=82?= =?UTF-8?q?=D0=B8=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Передавая функции название события, место проведения, время проведения, список участников и рэйтинг, мы получаем объект "Событие" --- Event.js | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 Event.js diff --git a/Event.js b/Event.js new file mode 100644 index 0000000..db5e189 --- /dev/null +++ b/Event.js @@ -0,0 +1,50 @@ +/** +* Event +* +* @param {String} [name = ""] +* @param {String} [address = ""] +* @param {Object} time +* @param {Array} member +* @param {Number} [raiting=3] ( 0 5) +* +* @example +* Event( +* "", ", . , . 4, . 150", +* EventTime(new Date(2011, 10, 10, 14, 48, 00), 60), +* [" "], 5) +* +* @return {Object} +* @see EventTime +*/ + +function Event(name, address, time, member, raiting) { + "use strict"; + return { + "name": name || "", + "address": address.toString(), + "time": time, + "member": member || [], + "raiting": +raiting || 3 + }; +} + + +/** +* EventTime +* +* @private +* @param {Number|Date} start +* @param {Number} [length=0] +* +* @example +* EventTime(new Date(2011, 10, 10, 14, 48, 00), 60) +* +* @return {Object} +*/ +function EventTime(start, length) { + "use strict"; + return { + "start": +start, + "length": +length || 0 + }; +} \ No newline at end of file From d95a298427f2ad8cf52127b7cc0457c88068e813 Mon Sep 17 00:00:00 2001 From: Sergey Zhigalov Date: Fri, 16 Nov 2012 09:13:04 +0600 Subject: [PATCH 2/2] =?UTF-8?q?=D0=9F=D0=BE=D0=BC=D0=B5=D0=BD=D1=8F=D0=BB?= =?UTF-8?q?=20=D0=BA=D0=BE=D0=B4=D0=B8=D1=80=D0=BE=D0=B2=D0=BA=D1=83=20?= =?UTF-8?q?=D1=84=D0=B0=D0=B9=D0=BB=D0=B0=20=D0=BD=D0=B0=20UTF-8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Event.js | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/Event.js b/Event.js index db5e189..2566d6a 100644 --- a/Event.js +++ b/Event.js @@ -1,17 +1,17 @@ -/** -* Event +/** +* Возвращает объект Event * -* @param {String} [name = ""] -* @param {String} [address = ""] -* @param {Object} time -* @param {Array} member -* @param {Number} [raiting=3] ( 0 5) +* @param {String} [name = "Событие"] Имя события +* @param {String} [address = ""] Адресс события +* @param {Object} time Дата события +* @param {Array} member Участники +* @param {Number} [raiting=3] Важность события (по шкале от 0 до 5) * * @example * Event( -* "", ", . , . 4, . 150", +* "Совещание", "Екатеринбург, ул. Тургенева, д. 4, ауд. 150", * EventTime(new Date(2011, 10, 10, 14, 48, 00), 60), -* [" "], 5) +* ["Жигалов Сергей Алексеевич"], 5) * * @return {Object} * @see EventTime @@ -20,7 +20,7 @@ function Event(name, address, time, member, raiting) { "use strict"; return { - "name": name || "", + "name": name || "Событие", "address": address.toString(), "time": time, "member": member || [], @@ -30,11 +30,11 @@ function Event(name, address, time, member, raiting) { /** -* EventTime +* Возвращает объект EventTime * * @private -* @param {Number|Date} start -* @param {Number} [length=0] +* @param {Number|Date} start Начало события +* @param {Number} [length=0] Длительность события в минутрах * * @example * EventTime(new Date(2011, 10, 10, 14, 48, 00), 60)