Opened 12 years ago

Closed 12 years ago

#5191 closed defect (fixed)

Incorrect i18n documentation on date formatting

Reported by: guest Owned by: Adam Peller
Priority: high Milestone:
Component: book Version: 0.9
Keywords: Cc:
Blocked By: Blocking:

Description

The example for date formatting in the i18n page is incorrect for dojo toolkit 1.0. It took me a little too long to figure out what was wrong - hopefully this will help prevent others from going down the same path I did :)

The example that is currently in the docs is:

msg = "Number of processed file number before ${1:dojo.date.format}:"   
         + "${0:dojo.number.format}";  
     console.debug(dojo.string.substitute(msg, [123456, new Date()]);

This should be:

msg = "Number of processed file number before ${1:dojo.date.locale.format}:"   
         + "${0:dojo.number.format}";  
     console.debug(dojo.string.substitute(msg, [123456, new Date()]);

Ideally, one would also include the required dojo.require() calls to make this work as easily as possible:

dojo.require('dojo.string');
dojo.require('dojo.currency');
dojo.require('dojo.date.locale');

msg = "Number of processed file number before ${1:dojo.date.locale.format}:"   
         + "${0:dojo.number.format}";  
     console.debug(dojo.string.substitute(msg, [123456, new Date()]);

Change History (2)

comment:1 Changed 12 years ago by Adam Peller

Owner: changed from carlavmott to Adam Peller

this looks like a stray 0.4 reference. I will fix - thanks in the future, please file comments/fixes directly on the book page.

comment:2 Changed 12 years ago by Adam Peller

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.