komalbansal1991 / datejs

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

toShortDateString() fr-CH #116

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. date-fr-CH.js

2.
var datejs = new Date(2010,10,30);
alert(datejs.toShortDateString());

alert(Date.CultureInfo.name);
alert(Date.CultureInfo.formatPatterns.shortDatePattern);

What is the expected output? What do you see instead?
expected:
30.11.2010
fr-CH
dd.MM.yyyy

real output:
Mon Feb 28 00:00:00 UTC+0100 2011
fr-CH
undefined

What version of the product are you using? On what operating system?
product:
/**
 * Version: 1.0 Alpha-1 
 * Build Date: 13-Nov-2007

Windows 7

Please provide any additional information below.

a) In date-fr-CH.js we define the Date.CultureInfo.formatPatterns as:
formatPatterns:{shortDate:"dd.MM.yyyy",longDate:"dddd, d. MMMM yyyy",
etc.

b) when we use them, for example in toShortDateString we use the wrong names 
for the patterns:
Date.prototype.toShortDateString=function(){return 
this.toString(Date.CultureInfo.formatPatterns.shortDatePattern);}

Original issue reported on code.google.com by sgorbini...@gmail.com on 17 Jan 2011 at 10:24

GoogleCodeExporter commented 8 years ago
This is a bug for all locales. It should either be: 

Date.prototype.toShortDateString=function(){return 
this.toString(Date.CultureInfo.formatPatterns.shortDate);}

or Date.CultureInfo.formatPatterns.shortDatePattern needs to be defined as an 
alias of or instead of Date.CultureInfo.formatPatterns.shortDate.

Original comment by bret...@gmail.com on 16 Apr 2011 at 6:37

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
toShortDateString isn't even valid in DateJS. Not a bug.

Original comment by darkcr...@gmail.com on 1 Oct 2013 at 10:36