@stdlib/time-iso-weeks-in-year
    TypeScript icon, indicating that this package has built-in type declarations

    0.0.7 • Public • Published

    isoWeeksInYear

    NPM version Build Status Coverage Status dependencies

    Determine the number of ISO weeks in a year according to the Gregorian calendar.

    Installation

    npm install @stdlib/time-iso-weeks-in-year

    Usage

    var isoWeeksInYear = require( '@stdlib/time-iso-weeks-in-year' );

    isoWeeksInYear( [value] )

    Returns the number of ISO weeks in a year according to the Gregorian calendar.

    var num = isoWeeksInYear();
    // returns <number>

    By default, the function returns the number of ISO weeks in the current year (according to local time). To determine the number of ISO weeks for a particular year, provide either a year or a Date object.

    var num = isoWeeksInYear( new Date() );
    // returns <number>
    
    num = isoWeeksInYear( 2015 );
    // returns 53
    
    num = isoWeeksInYear( 2017 );
    // returns 52

    Examples

    var isoWeeksInYear = require( '@stdlib/time-iso-weeks-in-year' );
    
    var v;
    var i;
    
    for ( i = 0; i < 2021; i++ ) {
        v = isoWeeksInYear( i );
        console.log( 'The year %d has %d ISO weeks.', i, v );
    }

    CLI

    Installation

    To use the module as a general utility, install the module globally

    npm install -g @stdlib/time-iso-weeks-in-year

    Usage

    Usage: iso-weeks-in-year [options] [year]
    
    Options:
    
      -h,    --help                Print this message.
      -V,    --version             Print the package version.
    

    Examples

    $ iso-weeks-in-year
    <number>

    For a specific year,

    $ iso-weeks-in-year 2015
    53

    Notice

    This package is part of stdlib, a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more.

    For more information on the project, filing bug reports and feature requests, and guidance on how to develop stdlib, see the main project repository.

    Community

    Chat


    License

    See LICENSE.

    Copyright

    Copyright © 2016-2021. The Stdlib Authors.

    Install

    npm i @stdlib/time-iso-weeks-in-year

    Homepage

    stdlib.io

    DownloadsWeekly Downloads

    48

    Version

    0.0.7

    License

    Apache-2.0

    Unpacked Size

    39.7 kB

    Total Files

    12

    Last publish

    Collaborators

    • stdlib-bot
    • kgryte
    • planeshifter
    • rreusser