MomentJS - Getter / Setter
MomentJS ma wiele metod pobierania / ustawiania danych wejściowych. Get pozwoli nam odczytać wymaganą jednostkę wejściową, a zestaw pozwoli na modyfikację jednostki wejściowej. W tym rozdziale szczegółowo omówiono metody get / set, które mają być używane w danym momencie.
W poniższej tabeli przedstawiono dostępne metody pobierania / ustawiania -
metoda | Składnia |
---|---|
Milisekunda | moment (). millisecond (liczba) moment (). millisecond (); moment (). milliseconds (liczba); moment (). milliseconds (); |
druga | moment (). sekunda (liczba); moment (). sekunda (); moment (). sekundy (liczba); moment (). sekundy (); |
Minuta | moment (). minuta (liczba); moment (). minuta (); moment (). minuty (liczba); moment (). minuty (); |
Godzina | moment (). data (liczba); moment (). data (); moment (). daty (liczba); moment (). daty (); |
Dzień tygodnia | moment (). dzień (liczba | ciąg); moment (). dzień (); moment (). dni (liczba | ciąg); moment (). dni (); |
Data miesiąca | moment (). data (liczba); moment (). data (); moment (). daty (liczba); moment (). daty (); |
Dzień roku | moment (). dayOfYear (liczba); moment (). dayOfYear (); |
Tydzień roku | moment (). tydzień (liczba); moment (). tydzień (); moment (). tygodnie (liczba); moment (). tygodnie (); |
Tydzień roku (ISO) | moment (). isoWeek (liczba); moment (). isoWeek (); moment (). isoWeeks (liczba); moment (). isoWeeks (); |
Miesiąc | moment (). miesiąc (liczba | ciąg); moment (). miesiąc (); |
Jedna czwarta | moment (). kwartał (); moment (). kwartał (liczba); moment (). kwartały (); moment (). kwartały (liczba); |
Rok | moment (). rok (liczba); moment (). rok (); |
Week year | moment (). weekYear (liczba); moment (). weekYear (); |
Weeks in year | moment (). weekInYear (); |
Dostać | moment (). get ('rok'); moment (). get ('miesiąc'); moment (). get ('data'); moment (). get ('godzina'); moment (). get ('minuta'); moment (). get ('sekunda'); moment (). get ('millisecond'); |
Zestaw | moment (). set (String, Int); moment (). set (Object (String, Int)); |
Maksymalny | moment.max (Moment [, Moment ...]); moment.max (Moment []); |
Minimum | moment.min (Moment [, Moment ...]); moment.min (Moment []); |