Skip to content

Commit

Permalink
Merge pull request #21 from subeshb1/fix/missing_default_methods
Browse files Browse the repository at this point in the history
fix(nepalidate): add prototype methods
  • Loading branch information
subeshb1 authored May 16, 2020
2 parents 8b62fb0 + d248805 commit 845f2e9
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/nepali-date-converter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ export default class NepaliDate {
* a.format('dd', 'np') // 'आइतबार'
* a.format('ddd DD, MMMM YYYY','np') // 'आइतबार १०, फाल्गुण २०५४'
* // Set static variable to 'np' for default Nepali language
* NepaliDate.Language = 'np'
* NepaliDate.language = 'np'
* a.format('ddd DD, MMMM YYYY') // 'आइतबार १०, फाल्गुण २०५४'
* ```
* @param formatString
Expand Down Expand Up @@ -407,4 +407,12 @@ export default class NepaliDate {
})
this[setAdBs](AD, BS)
}

valueOf() {
return this[jsDateSymbol].getTime()
}

toString() {
return this.format('ddd DD, MMMM YYYY')
}
}

0 comments on commit 845f2e9

Please sign in to comment.