ugrás a tartalomhoz

jQuery Date Input [ÉV-HÓ-NAP]

simisoma · 2009. Már. 31. (K), 17.06
Sziasztok!

A JQuery -nek létezik egy jQuery Date Input nevű modulja.

Nem tudja valaki leírni, hogy tudnám a megjelenést az alábbi formátumra állítani: ÉV-HÓ-NAP

Köszönöm! -SimiSoma
 
1

prototype

Poetro · 2009. Már. 31. (K), 17.28
  1. $(function() {  
  2.   // Fefüldefiniáljuk a dateToString függvényt hogy a kívánt formátumban írja ki a dátumot  
  3.   DateInput.prototype.dateToString = function(date) {  
  4.     return date.getFullYear() + "-" + this.short_month_names[date.getMonth()] + "-" + date.getDate();  
  5.   };  
  6.   // Fefüldefiniáljuk a stringToDate függvényt hogy a fel tudja dolgozni az új formátumot  
  7.   DateInput.prototype.stringToDate = function(string) {  
  8.     var matches;  
  9.     if (matches = string.match(/^(\d{1,2}) ([^\s]+) (\d{4,4})$/)) {  
  10.       return new Date(matches[3], this.shortMonthNum(matches[2]), matches[1], 12, 00);  
  11.     } else if (matches = string.match(/^(\d{4,4})-([^\s]+)-(\d{1,2})$/)) {  
  12.       return new Date(matches[1], this.shortMonthNum(matches[2]), matches[3], 12, 00);  
  13.     } else {  
  14.       return null;  
  15.     };  
  16.   };  
  17.   
  18.   $("#my_specific_input").date_input();  
  19. });  
2

Köszönet!

simisoma · 2009. Már. 31. (K), 18.38
Szuper vagy! köszönöm... :-)