jmoenig/Snap--Build-Your-Own-Blocks — pull request #288 by cycomachead (2013-12-28 04:31:29+00:00)
Title: Create a "Date" Block for Snap

This creates a new sensing block for working with Dates and times.

It's merely a reporter with a dropbown menu and mostly straightforward JS. Here's what it includes:

It has the following options:
```
{ 'Date' : 'toLocaleDateString',
'Year' : 'getFullYear',
'Month' : 'getMonthName', // return a name, not a number
'Day of Week' : 'getDayName', // return a name, not a number
'Day of Month': 'getDate',
'Time' : 'toLocaleTimeString',
'Hour' : 'getHours',
'Minute' : 'getMinutes',
'Second' : 'getSeconds',
'Milliseconds' : 'getMilliseconds',
'Time in Milliseconds' : 'getTime',
'UTC Time' : 'toUTCString' };
```

I'm looking for feedback, especially on label names, or things to add or remove from the function. These were my goals:
* Expose enough properties to make use of dates simple
* Don't expose too many redundant functions
* Hide the oddities of JS / Programming --
* Numbers are converted to their string equivalent
* dates and times use the 'locale' features of JS so they should be in a format users are familiar with.
* I exposed the 'time in ms since 1970' part of JS because it will allow users to (fairly) easily make their own timers
* I'm not sure if UTC time will be super helpful?
* I can also include the timezone difference (+/- X hours from UTC) but I'm not sure if students need that.

Things to be done: (Before this is fully accepted as a P.R.)
*[ ] Add a help image for the date block
*[ ] Translate the block text
*[ ] Translate the drop down menu
*[ ] Test in a non-US locale
*[ ] Translate Months and Days of the week
* I tried adding a localize call at the end of threads.js:3115, but I can't get it to local french or german months.
*[ ] Verify the ordering of the drop down items makes sense.