usha123 / datejs

Automatically exported from code.google.com/p/datejs
Other
0 stars 0 forks source link

Standard Date Specified 'd' is superseded by Custom Date Specifier #157

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. var date = new Date.parse('13-Aug-2012');
2. console.log(date.toString('d'));

What is the expected output? What do you see instead?
Expected "13", seeing "13/08/2012"

What version of the product are you using? On what operating system?
datejs 1.0 Alpha-1, Mac OS X 10.8

Please provide any additional information below.
The quick workaround is to use either date.toString('d ') or 
date.toString('dd'), where in both cases I have to strip the space or the zero 
(parseInt helps).

There should be a different letter for the standard or the custom specifier.

Original issue reported on code.google.com by aviol...@gmail.com on 13 Aug 2012 at 2:03

GoogleCodeExporter commented 8 years ago
Intended behavior for this. Standard Format Specifiers (which "d" is) will 
always take precedence. 

You can still get this information though - you should use date.getDate() 

Original comment by darkcr...@gmail.com on 9 Sep 2013 at 8:56