Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dose not work with systemJs!? #7

Open
ghost opened this issue Mar 1, 2017 · 3 comments
Open

Dose not work with systemJs!? #7

ghost opened this issue Mar 1, 2017 · 3 comments

Comments

@ghost
Copy link

ghost commented Mar 1, 2017

Any working sample for typescript with systemjs?

@arashm
Copy link
Owner

arashm commented Mar 1, 2017

I have no experience with TypeScript so far. I'm going to review the lib in coming holidays and rewrite it with ES6.

@a3dho3yn
Copy link

a3dho3yn commented May 2, 2017

In TypeScript, you can use jalali-date with import * as jDate from 'jalali-date';
and you need to define jDate type somewhere (like global.d.ts)

declare namespace jDate {
    interface jDate {
        (date: Date|Array): jDate;
        date: Array;
        _d: Date;
        getFullYear(): number;
        getMonth(): number;
        getDate(): number;
        getDay(): number;
        setFullYear(value: number): void;
        setMonth(value: number): void;
        setDate(value: number): void;
        format(format: string): string;
        isLeapYear(year: number): boolean;
        daysInMonth(year: number, month: number): number;
        to_gregorian(year: number, month: number, day: number): Date;
        to_jalali(date: Date): jDate;
    };
}

declare module "jalali-date" {
    declare var jDate: jDate.jDate;
    export = jDate;
}

@a3dho3yn
Copy link

a3dho3yn commented May 2, 2017

@arashm It's good to register type definition in DefinitelyTyped.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants