Skip to content

Commit

Permalink
moment library can provide multiple month names.
Browse files Browse the repository at this point in the history
  • Loading branch information
ypid committed Nov 20, 2015
1 parent 9a93350 commit 558a5ad
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion js/opening_hours_table.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,17 @@ var OpeningHoursTable = {
atday = i18n.t('words.on weekday') + i18n.t('weekdays.word next.' + this.weekdays[nextchange.getDay()])
+' '+ moment.weekdays(nextchange.getDay());

var atdate = nextchange.getDate() + ' ' + moment.months(nextchange.getMonth());
var month_name = moment.months(nextchange.getMonth());
var month_name_match = month_name.match(/\(([^|]+?)\|.*\)/);
if (month_name_match && typeof month_name_match[1] === 'string') {
/* The language has multiple words for the month (nominative, subjective).
* Use the first one.
* https://github.com/ypid/opening_hours_map/issues/41
*/
month_name = month_name_match[1];
}

var atdate = nextchange.getDate() + ' ' + month_name;

var res = [];

Expand Down

0 comments on commit 558a5ad

Please sign in to comment.