diff options
| author | Michael Ball <cycomachead@gmail.com> | 2013-12-28 15:01:24 -0800 |
|---|---|---|
| committer | Michael Ball <cycomachead@gmail.com> | 2013-12-28 15:01:24 -0800 |
| commit | 9f0f9dde37730dea46539c4c8971561a0a042354 (patch) | |
| tree | 8127d4f6649f4b698aad9a165cc2ce66fb8f1a68 /threads.js | |
| parent | faa8b4fe2243b1a8ef5cc4342183f4880b728a3d (diff) | |
| download | snap-9f0f9dde37730dea46539c4c8971561a0a042354.tar.gz snap-9f0f9dde37730dea46539c4c8971561a0a042354.zip | |
Add style tweaks per Nathan's comments.
Diffstat (limited to 'threads.js')
| -rw-r--r-- | threads.js | 37 |
1 files changed, 17 insertions, 20 deletions
@@ -83,7 +83,7 @@ ArgLabelMorph, localize, XML_Element, hex_sha512*/ // Global stuff //////////////////////////////////////////////////////// -modules.threads = '2013-December-11'; +modules.threads = '2013-December-28'; var ThreadManager; var Process; @@ -2475,31 +2475,28 @@ Process.prototype.reportTimer = function () { }; // Process Dates and times in Snap +// Map block options to built-in functions +var dateMap = { + 'date' : 'toLocaleDateString', + 'time' : 'toLocaleTimeString', + 'month' : 'getMonthName', // return a name, not a number + 'year' : 'getFullYear', + 'day of week' : 'getDayName', // return a name, not a number + 'day of month': 'getDate', + 'hour' : 'getHours', + 'minute' : 'getMinutes', + 'second' : 'getSeconds', + 'milliseconds' : 'getMilliseconds', + 'time in milliseconds' : 'getTime', + 'UTC time' : 'toUTCString' }; Process.prototype.reportDate = function (datefn) { - // Map block options to built-in functions - var dateMap = { 'Date' : 'toLocaleDateString', - 'Time' : 'toLocaleTimeString', - 'Month' : 'getMonthName', // return a name, not a number - 'Day of Week' : 'getDayName', // return a name, not a number - 'Day of Month': 'getDate', - 'Year' : 'getFullYear', - 'Hour' : 'getHours', - 'Minute' : 'getMinutes', - 'Second' : 'getSeconds', - 'Milliseconds' : 'getMilliseconds', - 'Time in Milliseconds' : 'getTime', - 'UTC Time' : 'toUTCString' }; - - if (!dateMap[datefn]) { - return ''; - } + if (!dateMap[datefn]) { return ''; } currDate = new Date(); - func = dateMap[datefn] + func = dateMap[datefn]; return currDate[func](); - } // Process code mapping |
