Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [JavaScript]Dynamiczne dodawanie dni
Randallmaster
post
Post #1





Grupa: Zarejestrowani
Postów: 677
Pomógł: 11
Dołączył: 18.11.2009

Ostrzeżenie: (0%)
-----


Witam serdecznie,

Muszę stworzyć przyciski dodające +7, +14,+21 dni

format daty: 00-00-000

  1. $data = date('d-m-Y');


W jaki sposób można to zrobić?
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
kamil4u
post
Post #2





Grupa: Zarejestrowani
Postów: 2 350
Pomógł: 512
Dołączył: 4.01.2009
Skąd: Wrocław / Świdnica

Ostrzeżenie: (0%)
-----


Pisane na szybko:
[JAVASCRIPT] pobierz, plaintext
  1. <script>
  2. var date;
  3. var dDate;
  4.  
  5. date = new Date();
  6. dDate = date.getDate() +'.'+ (parseInt(date.getMonth())+1) +'.'+ date.getFullYear();
  7. alert( dDate );
  8.  
  9. date.setDate( date.getDate()+7 );
  10. dDate = date.getDate() +'.'+ (parseInt(date.getMonth())+1) +'.'+ date.getFullYear();
  11. alert( dDate );
  12.  
  13. date.setDate( date.getDate()+7 );
  14. dDate = date.getDate() +'.'+ (parseInt(date.getMonth())+1) +'.'+ date.getFullYear();
  15. alert( dDate );
  16.  
  17. date.setDate( date.getDate()+7 );
  18. dDate = date.getDate() +'.'+ (parseInt(date.getMonth())+1) +'.'+ date.getFullYear();
  19. alert( dDate );
  20. </script>
[JAVASCRIPT] pobierz, plaintext


Ten post edytował kamil4u 12.01.2013, 13:47:54
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 14.10.2025 - 07:15