Skip to content

Commit

Permalink
fix document
Browse files Browse the repository at this point in the history
  • Loading branch information
babakhani committed Oct 12, 2017
1 parent aa30711 commit f9ed6a8
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 18 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,5 +179,5 @@ Thanks to [Vahid Mardani](https://github.com/pylover) for everything that I lear
, [Bita Edalati](http://github.com/bitaedalati) for create amazing [Playground](http://babakhani.github.io/PersianWebToolkit/doc/datepicker/playground.html)

## license
Freely distributable under the terms of the [WTFPL](http://www.wtfpl.net/) license.

[WTFPL](http://www.wtfpl.net/)
2 changes: 1 addition & 1 deletion dist/doc/API.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<a name="API"></a>

## API
Default API class
This is the API documentation for persian-datepicker

**Kind**: global class

Expand Down
4 changes: 3 additions & 1 deletion dist/doc/OPTIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ If set true datepicker init with input value date, use data-date property when y
<a name="Config.initialValueType"></a>

## Config.initialValueType : <code>boolean</code>
If set true datepicker init with input value date
Initial value calendar type, accept: 'persian', 'gregorian'

**Kind**: static property of [<code>Config</code>](#Config)
**Default**: <code>true</code>
Expand All @@ -245,6 +245,8 @@ If set true datepicker init with input value date
## <del>Config.persianDigit : <code>boolean</code></del>
***Deprecated***

from v1.0.0 this options is deprecated, use calendar.persian.locale instead

**Kind**: static property of [<code>Config</code>](#Config)
**Default**: <code>true</code>
<a name="Config.viewMode"></a>
Expand Down
1 change: 1 addition & 0 deletions doc/EXAMPLE.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ $('.gregorian-example').persianDatepicker({
inline: true,
altField: '#gregorianExampleAlt',
altFormat: 'LLLL',
calendarType: 'gregorian',
toolbox:{
calendarSwitch:{
enabled: true
Expand Down
20 changes: 10 additions & 10 deletions src/es6/api.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/**
* Default API class
* This is the API documentation for persian-datepicker
*/
class API {
constructor(model) {
constructor (model) {
this.model = model;
}

Expand All @@ -11,7 +11,7 @@ class API {
* @example var pd = $('.selector').persianDatepicker();
* console.log(pd.options);
*/
get options() {
get options () {
return this.model.options;
}

Expand All @@ -23,7 +23,7 @@ class API {
* pd.options = {};
* // set options and render datepicker with new options
*/
set options(inputOptions) {
set options (inputOptions) {
let opt = $.extend(true, this.model.options, inputOptions);
this.destroy();
this.model.components(this.model.inputElement, opt);
Expand All @@ -34,7 +34,7 @@ class API {
* @example var pd = $('.selector').persianDatepicker();
* pd.show();
*/
show() {
show () {
this.model.view.show();
this.model.options.onShow(this);
return this.model;
Expand All @@ -49,7 +49,7 @@ class API {
* console.log(state.selected);
* console.log(state.view);
* */
getState() {
getState () {
return this.model.state;

}
Expand All @@ -59,7 +59,7 @@ class API {
* @example var pd = $('.selector').persianDatepicker();
* pd.show();
*/
hide() {
hide () {
this.model.view.hide();
this.model.options.onHide(this);
return this.model;
Expand All @@ -70,7 +70,7 @@ class API {
* @example var pd = $('.selector').persianDatepicker();
* pd.toggle();
*/
toggle() {
toggle () {
this.model.view.toggle();
this.model.options.onToggle(this.model);
return this.model;
Expand All @@ -82,7 +82,7 @@ class API {
* @example var pd = $('.selector').persianDatepicker();
* pd.destroy();
*/
destroy() {
destroy () {
// TODO: destroy every thing
this.model.view.destroy();
this.model.options.onDestroy(this.model);
Expand All @@ -96,7 +96,7 @@ class API {
* @example var pd = $('.selector').persianDatepicker();
* pd.setDate(1382276091100)
*/
setDate(unix) {
setDate (unix) {
this.model.state.setSelectedDateTime('unix', unix);
this.model.state.setViewDateTime('unix', unix);
this.model.state.setSelectedDateTime('unix', unix);
Expand Down
11 changes: 6 additions & 5 deletions src/es6/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,16 @@ const Config = {


/**
* @description If set true datepicker init with input value date
* @description Initial value calendar type, accept: 'persian', 'gregorian'
* @type boolean
* @default true
*/
'initialValueType': 'gregorian',


/**
* @deprecated from v1.0.0 this options is deprecated, use calendar.persian.locale instead
* @description from v1.0.0 this options is deprecated, use calendar.persian.locale instead
* @deprecated
* @type boolean
* @default true
*/
Expand Down Expand Up @@ -169,7 +170,7 @@ const Config = {
*/
'formatter': function (unixDate) {
let self = this,
pdate = this.model.PersianDate.date(unixDate);
pdate = this.model.PersianDate.date(unixDate);
return pdate.format(self.format);
},

Expand Down Expand Up @@ -217,8 +218,8 @@ const Config = {
*/
'altFieldFormatter': function (unixDate) {
let self = this,
thisAltFormat = self.altFormat.toLowerCase(),
pd;
thisAltFormat = self.altFormat.toLowerCase(),
pd;
if (thisAltFormat === 'gregorian' || thisAltFormat === 'g') {
return new Date(unixDate);
}
Expand Down

0 comments on commit f9ed6a8

Please sign in to comment.