simple-week-calendar
v1.0.1
Published
simple weekly calendar using momentjs
Downloads
5
Readme
Simple-Week-calendar.
" simple-week-calendar " module is development module based on moment js. you can easily setup and retrieve weekly date calendar information from json format.
Pre Requesting.
This module will prerequest "bluebird" and "moment" npm package. you have to have install these tow packages in your project folder.
1- serfe into yor project folder 2- open the terminal and run
$ npm install Bluebird moment --save
Installation
add " simple-week-calendar " dependency to your project, simply run the following code in your terminal.
$ npm install simple-week-calendar --save
How it works
This node package develop for simply get weekly date information as joson format.
import the week callander dependancy.
const {DateByWeek} = require('simple-week-calendar')
to get details of the current week, simply pass the index value to the " DateByWeek " reference Eg:- get current week
const {DateByWeek} = require('simple-week-calendar')
const thisWeek = DateByWeek(0);
console.log(thisWeek);
output:-
{
"dateset": [
{
"DateText": "Mon - 12th Feb",
"dayname": "Mon",
"dayvalue": "12",
"monthName": "Feb",
"year": "2018",
"Date": "12/02/2018",
"WeekNumber": 7
},
{
"DateText": "Tue - 13th Feb",
"dayname": "Tue",
"dayvalue": "13",
"monthName": "Feb",
"year": "2018",
"Date": "13/02/2018",
"WeekNumber": 7
},
{
"DateText": "Wed - 14th Feb",
"dayname": "Wed",
"dayvalue": "14",
"monthName": "Feb",
"year": "2018",
"Date": "14/02/2018",
"WeekNumber": 7
},
{
"DateText": "Thu - 15th Feb",
"dayname": "Thu",
"dayvalue": "15",
"monthName": "Feb",
"year": "2018",
"Date": "15/02/2018",
"WeekNumber": 7
},
{
"DateText": "Fri - 16th Feb",
"dayname": "Fri",
"dayvalue": "16",
"monthName": "Feb",
"year": "2018",
"Date": "16/02/2018",
"WeekNumber": 7
},
{
"DateText": "Sat - 17th Feb",
"dayname": "Sat",
"dayvalue": "17",
"monthName": "Feb",
"year": "2018",
"Date": "17/02/2018",
"WeekNumber": 7
},
{
"DateText": "Sun - 18th Feb",
"dayname": "Sun",
"dayvalue": "18",
"monthName": "Feb",
"year": "2018",
"Date": "18/02/2018",
"WeekNumber": 8
}
],
"thisisMonday": "2018-02-19T03:53:15.726Z",
"thisisSunday": "2018-02-18T03:53:15.726Z",
"today": "Mon - 12th Feb"
}
for next week
DateByWeek(1);
for the previous week
DateByWeek(-1);
the week after next week.
DateByWeek(2);
License
MIT