arshaw / xdate

A Modern JavaScript Date Library
http://arshaw.com/xdate/
GNU General Public License v2.0
681 stars 81 forks source link

Added getMonthWeeks method and spanish locale #17

Closed jbalde closed 11 years ago

jbalde commented 11 years ago

Spanish locale added with all days and month translated. Added a new feature firstDay to indicate what day is the first day of the week. In England the week start on Sunday. In Spain the week start on Monday. The getMonthWeek method return a week array in a month and any week have a 7 days array started in firstDay locale configuration.

arshaw commented 11 years ago

Hi @jbalde, I'm very sorry it has taken so long to get back to you. Here are my thoughts on the 2 aspects of your pull request:

getMonthWeeks - This seems a little too specific to your usecase to include in the core of the library. Keep in mind you can always attach methods to XDate.prototype to extend the functionality yourself.

firstDay & espagnol - Thank you for translating into spanish! Also, you are right: to correctly support many languages, the firstDay value needs to be defined. This is part of a larger internationalization issue... I'd like to have more robust format for specifying other languages, and have those language reside in separate files. Since there is still a lot of work to do on this front, I'm going to hold off on accepting this pull request and instead, make a note of it on the real i18n issue. Thanks