Skip to content

Commit

Permalink
v0.5.5
Browse files Browse the repository at this point in the history
  • Loading branch information
reza bbakhani committed Aug 18, 2017
1 parent edcd9e9 commit 3a50bf7
Show file tree
Hide file tree
Showing 15 changed files with 65 additions and 69 deletions.
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Persian Date Picker

[![npm version](https://badge.fury.io/js/persian-datepicker.svg)](https://badge.fury.io/js/persian-datepicker)
[![Bower version](https://badge.fury.io/bo/persian-datepicker.svg)](https://badge.fury.io/bo/persian-datepicker)
[![Travis-ci](https://travis-ci.org/babakhani/pwt.datepicker.svg?branch=refactor)](https://badge.fury.io/bo/persian-datepicker)
[![Travis-ci](https://travis-ci.org/babakhani/pwt.datepicker.svg?branch=master)](https://badge.fury.io/bo/persian-datepicker)

Persian Date Picker
This Date picker work with Iranian calendar.
Expand All @@ -18,9 +18,8 @@ More info at [Wikipedia](http://en.wikipedia.org/wiki/Iranian_calendar)
<a class="github-button" href="https://github.com/babakhani/pwt.datepicker/fork" data-icon="octicon-repo-forked" data-style="mega" data-count-href="/babakhani/pwt.datepicker/network" data-count-api="/repos/babakhani/pwt.datepicker#forks_count" data-count-aria-label="# forks on GitHub" aria-label="Fork babakhani/pwt.datepicker on GitHub">Fork</a>



- [Documents](http://babakhani.github.io/PersianWebToolkit/beta/datepicker)
- [Demo](http://babakhani.github.io/PersianWebToolkit/beta/datepicker/example)
- [Documents](http://babakhani.github.io/PersianWebToolkit/doc/datepicker)
- [Demo](http://babakhani.github.io/PersianWebToolkit/doc/datepicker/example)


## Table of content:
Expand Down
2 changes: 1 addition & 1 deletion assets/persian-date.min.js

Large diffs are not rendered by default.

36 changes: 5 additions & 31 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "persian-datepicker",
"version": "0.5.0",
"version": "0.5.5",
"main": [
"dist/css/persian-datepicker-0.5.0.min.css",
"dist/js/persian-datepicker-0.5.0.min.js"
"dist/css/persian-datepicker.min.css",
"dist/js/persian-datepicker.min.js"
],
"ignore": [
".*",
Expand All @@ -14,7 +14,7 @@
],
"dependencies": {
"jquery": "2.2.0",
"persian-date": "0.1.8"
"persian-date": "0.2.3"
},
"keywords": [
"bootstrap-datetimepicker",
Expand All @@ -33,37 +33,11 @@
"bugs": {
"url": "https://github.com/babakhani/pwt.datepicker/issues"
},
"devDependencies": {
"babel-cli": "^6.0.0",
"babel-core": "^6.22.1",
"babel-loader": "^6.2.10",
"babel-plugin-transform-runtime": "^6.22.0",
"babel-polyfill": "^6.22.0",
"babel-preset-es2015": "^6.22.0",
"babel-runtime": "^6.22.0",
"bootstrap": "^3.3.7",
"grunt": "^1.0.1",
"grunt-cli": "^1.2.0",
"grunt-contrib-concat": "^1.0.1",
"grunt-contrib-copy": "^1.0.0",
"grunt-contrib-sass": "^1.0.0",
"grunt-contrib-uglify": "^2.2.0",
"grunt-contrib-watch": "*",
"grunt-jsdoc-to-markdown": "^3.0.0",
"hamsterjs": "=1.1.2",
"jshint": "^2.6.0",
"load-grunt-tasks": "^3.5.2",
"mustache": "=2.3.0",
"persian-date": "^0.1.8",
"sass-lint": "^1.10.2",
"simple-server": "^1.0.1",
"sync-pkg": "^0.7.2"
},
"authors": [
"Reza Babakhani <[email protected]>"
],
"files": [
"dist"
],
"description": "jQuery datepicker plugin work with Iranian calendar."
"description": "jQuery datepicker plugin work with Iranian calendar.",
}
7 changes: 7 additions & 0 deletions dist/css/persian-datepicker.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/*
** persian-datepicker - v0.5.5
** Reza Babakhani <[email protected]>
** http://babakhani.github.io/PersianWebToolkit/docs/datepicker
** Under WTFPL license
*/

.datepicker-plot-area {
-moz-user-select: none;
-khtml-user-select: none;
Expand Down
2 changes: 1 addition & 1 deletion dist/css/persian-datepicker.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/css/theme/persian-datepicker-blue.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/css/theme/persian-datepicker-cheerup.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/css/theme/persian-datepicker-dark.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/css/theme/persian-datepicker-redblack.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
<div class="container">
<div class="navbar-header">
<a class="navbar-brand" href="#">
Persian Date Picker <span class="badge">Beta Version 0.5.4</span>
Persian Date Picker <span class="badge">Beta Version 0.5.5</span>
</a>
</div>
<nav class="navbar-right">
Expand Down
7 changes: 7 additions & 0 deletions dist/js/persian-datepicker.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/*
** persian-datepicker - v0.5.5
** Reza Babakhani <[email protected]>
** http://babakhani.github.io/PersianWebToolkit/docs/datepicker
** Under WTFPL license
*/

(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory();
Expand Down
2 changes: 1 addition & 1 deletion dist/js/persian-datepicker.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions doc/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [0.5.5]
### Changed
- fix days rendering
- fix readme


## [0.5.4]
### Changed
Expand Down
8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "persian-datepicker",
"version": "0.5.4",
"version": "0.5.5",
"description": "jQuery datepicker plugin work with Iranian calendar.",
"keywords": [
"jquery-plugin",
Expand All @@ -24,13 +24,17 @@
"url": "https://github.com/babakhani/pwt.datepicker/issues"
},
"devDependencies": {
"babel-core": "^6.26.0",
"babel-loader": "^7.1.1",
"babel-preset-es2015": "^6.24.1",
"grunt": "^1.0.1",
"grunt-banner": "^0.6.0",
"grunt-cli": "^1.2.0",
"grunt-contrib-watch": "*",
"grunt-jsdoc-to-markdown": "^3.0.0",
"grunt-sass": "^2.0.0",
"grunt-webpack": "^2.0.1",
"hamsterjs": "^1.1.2",
"jshint": "^2.6.0",
"load-grunt-tasks": "^3.5.2",
"mustache": "=2.3.0",
Expand All @@ -44,7 +48,7 @@
},
"dependencies": {
"jquery": "2.2.0",
"persian-date": "=0.1.8-b"
"persian-date": "0.2.3"
},
"scripts": {
"start": "node_modules/.bin/webpack-dev-server & grunt --dev",
Expand Down
48 changes: 24 additions & 24 deletions src/es6/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class View {
* @param {Datepicker} model
* @return {View}
*/
constructor(model) {
constructor (model) {

/**
* @type {number}
Expand Down Expand Up @@ -62,14 +62,14 @@ class View {
/**
* @desc remove datepicker container element from dom
*/
destroy() {
destroy () {
this.$container.remove();
}

/**
* @desc set datepicker container element based on <input/> element position
*/
setPickerBoxPosition() {
setPickerBoxPosition () {
let inputPosition = this.model.input.getInputPosition();
let inputSize = this.model.input.getInputSize();
if (this.model.options.position === "auto") {
Expand All @@ -88,22 +88,22 @@ class View {
/**
* @desc show datepicker container element
*/
show() {
show () {
this.$container.show();
this.setPickerBoxPosition();
}

/**
* @desc hide datepicker container element
*/
hide() {
hide () {
this.$container.hide();
}

/**
* @desc toggle datepicker container element
*/
toggle() {
toggle () {
this.$container.toggle();
}

Expand All @@ -113,7 +113,7 @@ class View {
* @private
* @return {String}
*/
_getNavSwitchText(data) {
_getNavSwitchText (data) {
let output;
if (this.model.state.viewMode == 'day') {
output = this.model.options.dayPicker.titleFormatter.call(this, data.year, data.month);
Expand All @@ -132,7 +132,7 @@ class View {
* @param {Number} year - year number
* @return {Boolean}
*/
checkYearAccess(year) {
checkYearAccess (year) {
let output = true;
if (this.model.state.filetredDate) {
let startYear = this.model.state.filterDate.start.year;
Expand All @@ -155,7 +155,7 @@ class View {
* @param viewState
* @return {{enabled: boolean, viewMode: boolean, list: Array}}
*/
_getYearViewModel(viewState) {
_getYearViewModel (viewState) {
/**
* @description Generate years list based on viewState year
* @return ['1380',n+12,'1392']
Expand Down Expand Up @@ -187,14 +187,14 @@ class View {
* @param {Number} month - month number
* @return {Boolean}
*/
checkMonthAccess(month) {
checkMonthAccess (month) {
let output = true,
y = this.model.state.view.year;
y = this.model.state.view.year;
if (this.model.state.filetredDate) {
let startMonth = this.model.state.filterDate.start.month,
endMonth = this.model.state.filterDate.end.month,
startYear = this.model.state.filterDate.start.year,
endYear = this.model.state.filterDate.end.year;
endMonth = this.model.state.filterDate.end.month,
startYear = this.model.state.filterDate.start.year,
endYear = this.model.state.filterDate.end.year;
if (startMonth && endMonth && ((y == endYear && month > endMonth) || y > endYear) || ((y == startYear && month < startMonth) || y < startYear)) {
return false;
}
Expand All @@ -214,7 +214,7 @@ class View {
* @private
* @return {{enabled: boolean, viewMode: boolean, list: Array}}
*/
_getMonthViewModel() {
_getMonthViewModel () {
let monthModel = [];
for (let month of ClassDateRange.monthRange) {
monthModel.push({
Expand All @@ -237,9 +237,9 @@ class View {
* @param {Number} thisUnix - month number
* @return {Boolean}
*/
checkDayAccess(unixtimespan) {
checkDayAccess (unixtimespan) {
let self = this,
output = true;
output = true;
self.minDate = this.model.options.minDate;
self.maxDate = this.model.options.maxDate;

Expand Down Expand Up @@ -271,7 +271,7 @@ class View {
* @private
* @return {object}
*/
_getDayViewModel() {
_getDayViewModel () {
if (this.model.state.viewMode != 'day') {
return [];
}
Expand All @@ -298,7 +298,7 @@ class View {
let calcedDate, otherMonth, pdate;
if (rowIndex === 0 && dayIndex < firstWeekDayOfMonth) {
pdate = new persianDate(this.model.state.view.dateObject.startOf('month').valueOf());
calcedDate = pdate.subtract('days', (firstWeekDayOfMonth - dayIndex));
calcedDate = pdate.subtract('days', ((firstWeekDayOfMonth) - dayIndex ));
otherMonth = true;
}
else if ((rowIndex === 0 && dayIndex >= firstWeekDayOfMonth) || (rowIndex <= 5 && daysListindex < daysCount)) {
Expand Down Expand Up @@ -335,7 +335,7 @@ class View {
* @private
* @return {{enabled: boolean, hour: {title, enabled: boolean}, minute: {title, enabled: boolean}, second: {title, enabled: boolean}, meridiem: {title: (meridiem|{title, enabled}|ClassDatepicker.ClassConfig.timePicker.meridiem|{enabled}|string|string), enabled: boolean}}}
*/
_getTimeViewModel() {
_getTimeViewModel () {
let hourTitle;
this.model.state.view.dateObject.formatPersian = this.model.options.persianDigit;

Expand Down Expand Up @@ -370,7 +370,7 @@ class View {
* @param data
* @return {*}
*/
getViewModel(data) {
getViewModel (data) {
return {
plotId: '',
navigator: {
Expand All @@ -395,7 +395,7 @@ class View {
* @render datepicker view element
* @param data
*/
render(data) {
render (data) {
Helper.debug(this, 'render');
Mustache.parse(Template);
this.rendered = $(Mustache.render(this.model.options.template, this.getViewModel(data)));
Expand All @@ -404,15 +404,15 @@ class View {
}


reRender() {
reRender () {
let data = this.model.state.view;
this.render(data);
}

/**
* @desc do after render work like attache events
*/
afterRender() {
afterRender () {
if (this.model.navigator) {
this.model.navigator.liveAttach();
}
Expand Down

0 comments on commit 3a50bf7

Please sign in to comment.