Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Get the date of first/last weekday from a specified date
CoffeeScript JavaScript
branch: master

main path fix (add ./)

latest commit 7edd34951e
Rong Shen authored
Failed to load latest commit information.
lib Start the repos
src Start the repos
.gitignore Start the repos Start the repos
package.json main path fix (add ./) Start the repos Start the repos

Overview #

This module provides a tool to get the date of first or last weekday from a specified date.

I use it to parse the Olson Timezone Rule File.


npm install first-last-weekday

firstLastWeekDay = require './lib/index'

d = new Date('2013-05-30')

# firstSun ~ firstSat
console.log 'firstSun',  firstLastWeekDay.firstSun(d).toDateString()

# lastSun ~ lastSat
console.log 'lastSun',  firstLastWeekDay.lastSun(d).toDateString()


firstSun Sun Jun 02 2013
lastSun Sun May 26 2013

Code written in Coffee-Script then compiled by grunt.


MIT License

Something went wrong with that request. Please try again.