Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions src/nepali-date-converter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
IAdBs,
format,
Language,
parse
parse,
} from './nepali-date-helper'

const dateSymbol = Symbol('Date')
Expand All @@ -17,6 +17,8 @@ const convertToBSMethod = Symbol('convertToBS()')
const convertToADMethod = Symbol('convertToAD()')
const setAdBs = Symbol('setADBS()')
const setDayYearMonth = Symbol('setDayYearMonth()')

export * from './date-config'
export default class NepaliDate {
private [jsDateSymbol]: Date
private [yearSymbol]: number
Expand Down Expand Up @@ -209,7 +211,7 @@ export default class NepaliDate {
getDateObject(): IAdBs {
return {
BS: this.getBS(),
AD: this.getAD()
AD: this.getAD(),
}
}
/**
Expand All @@ -229,7 +231,7 @@ export default class NepaliDate {
year: this[yearSymbol],
month: this[monthSymbol],
date: this[dateSymbol],
day: this[daySymbol]
day: this[daySymbol],
}
}
/**
Expand All @@ -249,7 +251,7 @@ export default class NepaliDate {
year: this[jsDateSymbol].getFullYear(),
month: this[jsDateSymbol].getMonth(),
date: this[jsDateSymbol].getDate(),
day: this[jsDateSymbol].getDay()
day: this[jsDateSymbol].getDay(),
}
}

Expand Down Expand Up @@ -403,7 +405,7 @@ export default class NepaliDate {
const { AD, BS } = convertToAD({
year: this[yearSymbol],
month: this[monthSymbol],
date: this[dateSymbol]
date: this[dateSymbol],
})
this[setAdBs](AD, BS)
}
Expand Down