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

Extensions? #53

Open
mingsai opened this issue Mar 18, 2022 · 1 comment
Open

Extensions? #53

mingsai opened this issue Mar 18, 2022 · 1 comment
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@mingsai
Copy link

mingsai commented Mar 18, 2022

I seem unable to get dcdg to represent extensions in my output.

part of 'extensions.dart';

extension intX on int {
  String toTime() {
    int h, m, s;

    h = this ~/ 3600;

    m = ((this - h * 3600)) ~/ 60;

    s = this - (h * 3600) - (m * 60);

    String hourLeft =
        h.toString().length < 2 ? "0" + h.toString() : h.toString();

    String minuteLeft =
        m.toString().length < 2 ? "0" + m.toString() : m.toString();

    String secondsLeft =
        s.toString().length < 2 ? "0" + s.toString() : s.toString();

    String result = "$hourLeft:$minuteLeft:$secondsLeft";

    return result;
  }
}
@glesica
Copy link
Owner

glesica commented Mar 18, 2022

There's no support for extensions at the moment.

@glesica glesica added enhancement New feature or request good first issue Good for newcomers labels Mar 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants