Skip to content

Commit

Permalink
fix calendar hint locale_ issue
Browse files Browse the repository at this point in the history
  • Loading branch information
babakhani committed Sep 26, 2017
1 parent a8c378a commit f2449a2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 14 deletions.
9 changes: 3 additions & 6 deletions dist/js/persian-datepicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -3223,10 +3223,10 @@ var View = function () {
key: '_getButtonText',
value: function _getButtonText() {
var output = {};
if (this.model.options.calendar_ == 'persian') {
if (this.model.options.locale_ == 'fa') {
output.todayButtontext = this.model.options.toolbox.todayButton.text.fa;
output.submitButtonText = this.model.options.toolbox.submitButton.text.fa;
} else {
} else if (this.model.options.locale_ == 'en') {
output.todayButtontext = this.model.options.toolbox.todayButton.text.en;
output.submitButtonText = this.model.options.toolbox.submitButton.text.en;
}
Expand All @@ -3240,12 +3240,9 @@ var View = function () {
loc = void 0;
if (that.model.options.calendar_ == 'persian') {
cal = 'gregorian';
} else {
cal = 'persian';
}
if (that.model.options.locale_ == 'fa') {
loc = that.model.options.calendar.gregorian.locale;
} else {
cal = 'persian';
loc = that.model.options.calendar.persian.locale;
}
return [cal, loc];
Expand Down
2 changes: 1 addition & 1 deletion dist/js/persian-datepicker.min.js

Large diffs are not rendered by default.

10 changes: 3 additions & 7 deletions src/es6/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -490,11 +490,11 @@ class View {

_getButtonText() {
let output = {};
if (this.model.options.calendar_ == 'persian') {
if (this.model.options.locale_ == 'fa') {
output.todayButtontext = this.model.options.toolbox.todayButton.text.fa;
output.submitButtonText = this.model.options.toolbox.submitButton.text.fa;
}
else {
else if (this.model.options.locale_ == 'en') {
output.todayButtontext = this.model.options.toolbox.todayButton.text.en;
output.submitButtonText = this.model.options.toolbox.submitButton.text.en;
}
Expand All @@ -506,14 +506,10 @@ class View {
let that = this, cal, loc;
if (that.model.options.calendar_ == 'persian') {
cal = 'gregorian';
}
else {
cal = 'persian';
}
if (that.model.options.locale_ == 'fa') {
loc = that.model.options.calendar.gregorian.locale;
}
else {
cal = 'persian';
loc = that.model.options.calendar.persian.locale;
}
return [cal, loc];
Expand Down

0 comments on commit f2449a2

Please sign in to comment.