-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
57 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
// Type definitions for moment-jalaali 0.7.0 | ||
// Project: https://github.com/jalaali/moment-jalaali | ||
// Definitions by: Ali Taheri Moghaddar <https://github.com/alitaheri> | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
|
||
import moment = require("moment"); | ||
|
||
export = moment; | ||
|
||
declare module "moment" { | ||
type JUnitOfTime = "jYear" | "jMonth"; | ||
|
||
interface LoadPersianOptions { | ||
/** | ||
* Use persian digits as decribed by unicode | ||
*/ | ||
usePersianDigits?: boolean; | ||
/** | ||
* use dialect option to change usePersian dialect, available options are: | ||
* persian: default dialect(امرداد، آدینه، ...) | ||
* persian-modern: modern dialect(مرداد، جمعه، ...) | ||
*/ | ||
dialect?: "persian" | "persian-modern"; | ||
} | ||
|
||
/** | ||
* Add persian language. | ||
*/ | ||
function loadPersian(options?: LoadPersianOptions): void; | ||
|
||
function jIsLeapYear(year: number): boolean; | ||
function jDaysInMonth(year: number, month: number): number; | ||
|
||
interface Moment { | ||
startOf(jUnitOfTime: JUnitOfTime): Moment; | ||
endOf(jUnitOfTime: JUnitOfTime): Moment; | ||
|
||
add(amount: string | number, jUnitOfTime: JUnitOfTime): Moment; | ||
|
||
subtract(amount: string | number, jUnitOfTime: JUnitOfTime): Moment; | ||
|
||
jYear(y: number): Moment; | ||
jYear(): number; | ||
jMonth(M: number | string): Moment; | ||
jMonth(): number; | ||
jDate(d: number): Moment; | ||
jDate(): number; | ||
jWeek(d: number): Moment; | ||
jWeek(): number; | ||
jWeekYear(d: number): Moment; | ||
jWeekYear(): number; | ||
jDayOfYear(d: number): Moment; | ||
jDayOfYear(): number; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters