Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I think the Javascript is showing the incorrect ordinals. When I refresh the page, I initially see 22nd, but this is quickly overwritten (presumably by the Javascript) to show 22th. I think the solution is in the file clock.js, the following works for me:
Change:
switch (day) {
case 1
var dayOfMonthAppend = Drupal.t('st');
break;
case 2:
var dayOfMonthAppend = Drupal.t('nd');
break;
case 3:
var dayOfMonthAppend = Drupal.t('rd');
break;
default:
var dayOfMonthAppend = Drupal.t('th');
break;
}
to:
switch (day) {
case 01: case 1: case 21: case 31:
var dayOfMonthAppend = Drupal.t('st');
break;
case 02: case 2: case 22:
var dayOfMonthAppend = Drupal.t('nd');
break;
case 03: case 3: case 23:
var dayOfMonthAppend = Drupal.t('rd');
break;
default:
var dayOfMonthAppend = Drupal.t('th');
break;
}
Since "day" is not always 1, 2, 3, and 11th, 12th and 13th do not follow the rule.
Comment | File | Size | Author |
---|---|---|---|
#1 | incorrect-ordinals.patch | 725 bytes | tstoeckler |
Comments
Comment #1
tstoecklerThanks very much!!!
I committed the attached patch. Please wait for up to 12 hours and try out the new development snapshot to see if it was fixed.
http://drupal.org/cvs?commit=454416
Comment #2
tstoecklerAlmost forgot Drupal 7.
http://drupal.org/cvs?commit=454422
http://drupal.org/cvs?commit=454420
Now correctly marking fixed.