[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/functions.php on line 4770: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3884)
[phpBB Debug] PHP Warning: in file /includes/functions.php on line 4772: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3884)
[phpBB Debug] PHP Warning: in file /includes/functions.php on line 4773: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3884)
[phpBB Debug] PHP Warning: in file /includes/functions.php on line 4774: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3884)
 Forum eduweb.pl • Wyświetl temat - Javascript jak przekonwertowac string na ilosc godzin? PILNE
Z uwagi na dużą liczbę wpisów stworzonych bez wątpienia wyłącznie w celu pozycjonowania stron na określone frazy, dodaliśmy do wszystkich linków (w postach i podpisach) atrybut rel="nofollow". Z tego względu wszystkie dodane linki straciły swoją moc pozycjonerską. Forum jest dla Was, dlatego prosimy o zamieszczanie wyłącznie "prawdziwych" tematów i odpowiedzi.

Javascript jak przekonwertowac string na ilosc godzin? PILNE

Dreamweaver, XHTML, CSS, JavaScript, jQuery
  • Wiadomości
Offline

hitek

  • Posty: 11
  • Rejestracja: 16 gru 2013, o 21:14

Javascript jak przekonwertowac string na ilosc godzin? PILNE

Post14 kwie 2017, o 21:00

Witam.
Zadano mi zbudować aplikację webową w angular.js która importuje dane z API JSON i wyświetla je na ekran. To już zrobiłem.

Problem pojawia się dalej. Z API wydobywam informacje w postaci string o wartościach takich jak: "3 months", "1 week", "3 years" i podobne tego typu; muszę te informacje przekonwertować do integera zawierającego ilość godzin: np. dla stringa "1 week" bedzie to 7*24 = 168 godzin.

W jaki sposób mogę napisać funkcję JavaScriptową która coś takiego przekonwertuje? w php użył bym strtotime a tu?

Dzięki za pomoc.
Offline
Awatar użytkownika

Piotr Palarz

Ekspert

Ekspert

  • Posty: 685
  • Rejestracja: 24 kwie 2012, o 00:37

Re: Javascript jak przekonwertowac string na ilosc godzin? P

Post15 kwie 2017, o 10:30


Wróć do Projektowanie w XHTML i CSS

Kto jest online

Użytkownicy przeglądający to forum: Obecnie na forum nie ma żadnego zarejestrowanego użytkownika i 0 gości

cron