Committer: dpetrov
LJSUP-12126: Port choose date widget from the old update.bml pageU trunk/htdocs/js/basic.js U trunk/htdocs/js/jquery/jquery.lj.entryDatePicker.js
Modified: trunk/htdocs/js/basic.js =================================================================== --- trunk/htdocs/js/basic.js 2012-05-23 11:07:05 UTC (rev 22037) +++ trunk/htdocs/js/basic.js 2012-05-23 11:46:35 UTC (rev 22038) @@ -348,9 +348,9 @@ function normalizeFormat(format) { if (!format || format === 'short') { - format = LiveJournal.getLocalizedStr('format.date.short'); + format = LiveJournal.getLocalizedStr('date.format.short'); } else if (format === 'long') { - format = LiveJournal.getLocalizedStr('format.date.long'); + format = LiveJournal.getLocalizedStr('date.format.long'); } return format; @@ -377,9 +377,6 @@ positions = [ null ], pos = 0, token, regs = { - '%y' : '(\\d{4})', - '%m' : '(\\d{2})', - '%d' : '(\\d{2})', '%Y' : '(\\d{4})', '%M' : '(\\d{2})', '%D' : '(\\d{2})' @@ -406,15 +403,12 @@ for( var i = 1; i < arr.length; ++i ) { if( positions[ i ] ) { switch( positions[ i ] ) { - case '%d': case '%D': d.setDate( arr[ i ] ); break; - case '%m': case '%M': d.setMonth( parseInt( arr[ i ], 10 ) - 1 ); break; - case '%y': case '%Y': d.setFullYear( arr[ i ] ); break; @@ -437,15 +431,12 @@ return format.replace( /%([a-zA-Z]{1})/g, function(str, letter) { switch (letter) { - case 'm' : case 'M' : return ('' + (date.getMonth() + 1)).pad(2, '0'); case 'B' : //full month return getMonth(date.getMonth()); - case 'd' : case 'D' : return ('' + date.getDate()).pad(2, '0'); - case 'y' : case 'Y' : return date.getFullYear(); case 'R' : Modified: trunk/htdocs/js/jquery/jquery.lj.entryDatePicker.js =================================================================== --- trunk/htdocs/js/jquery/jquery.lj.entryDatePicker.js 2012-05-23 11:07:05 UTC (rev 22037) +++ trunk/htdocs/js/jquery/jquery.lj.entryDatePicker.js 2012-05-23 11:46:35 UTC (rev 22038) @@ -183,7 +183,7 @@ var calOptions = { currentDate: this.currentDate, - dateFormat: LiveJournal.getLocalizedStr('format.date.short'), + dateFormat: LiveJournal.getLocalizedStr('date.format.short'), ml: { caption: LiveJournal.getLocalizedStr('entryform.choose_date', null, 'Choose date:') },