Andrey (azangru) wrote,

Из архивов Stack Overflow:

Вопрос: Check if year is leap year in javascript

Первый ответ:

Несколько позже другой ответ:

Хмм. Смотрю в исходники библиотеки:

return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0

the dirty details of getting all of the special cases right, говорите?

Recent Posts from This Journal

  • (no subject)

    Thought of this phrase today for some reason, then thought whether it exists in English (putting toothpaste back into the tube came to mind), then…

  • (no subject)

    I think many (perhaps most) people are totally fine with being a free-rider, a bludger, or a sponge (remember Trump who said that he pays little…

  • (no subject)

    Someone who self-identifies as a technical writer, among other things, begins her article How To Build An E-Commerce Site With Angular 11, Commerce…

  • Post a new comment


    default userpic
    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.