Skip to content

Instantly share code, notes, and snippets.

@Thanood
Last active June 26, 2017 18:31
Show Gist options
  • Select an option

  • Save Thanood/dbc68795d93a7b32e90c898a068a1b67 to your computer and use it in GitHub Desktop.

Select an option

Save Thanood/dbc68795d93a7b32e90c898a068a1b67 to your computer and use it in GitHub Desktop.

Revisions

  1. Thanood revised this gist Jun 26, 2017. 1 changed file with 0 additions and 12 deletions.
    12 changes: 0 additions & 12 deletions _tips.md
    Original file line number Diff line number Diff line change
    @@ -1,12 +0,0 @@
    #### tab targetting

    To enable the datepicker to become a valid tab target (as in: responds to the correct tab order),
    set the container to be the parent of the datepicker input. Like this:

    ```js
    <div ref="dpWrapper">
    <input md-datepicker="container.bind: dpWrapper; value.two-way: selectedDate;" type="date" placeholder="pick a date" />
    </div>

    ```

  2. Thanood revised this gist Jun 26, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion app.html
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    <template>
    <div>
    <input md-timepicker value.two-way="time" placeholder="pick a date" />
    <input md-timepicker="value.bind: time;" placeholder="pick a date" />
    </div>
    <div>
    <button md-button click.delegate="setTime()">set time</button>
  3. Thanood revised this gist Jun 26, 2017. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions app.html
    Original file line number Diff line number Diff line change
    @@ -1,11 +1,11 @@
    <template>
    <div>
    <input md-timepicker value.bind="time" placeholder="pick a date" />
    <input md-timepicker value.two-way="time" placeholder="pick a date" />
    </div>
    <div>
    <button md-button click.delegate="setTime()">set time</button>
    </div>
    <div>
    <span if.bind="time">You selected (UTC time): ${time | stringify}</span>
    <span if.bind="time">You selected: ${time | stringify}</span>
    </div>
    </template>
  4. Thanood revised this gist Jun 26, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion app.html
    Original file line number Diff line number Diff line change
    @@ -6,6 +6,6 @@
    <button md-button click.delegate="setTime()">set time</button>
    </div>
    <div>
    <span if.bind="selectedTime">You selected (UTC time): ${selectedTime | stringify}</span>
    <span if.bind="time">You selected (UTC time): ${time | stringify}</span>
    </div>
    </template>
  5. Thanood revised this gist Jun 26, 2017. 2 changed files with 4 additions and 5 deletions.
    2 changes: 1 addition & 1 deletion app.html
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    <template>
    <div>
    <input md-timepicker placeholder="pick a date" />
    <input md-timepicker value.bind="time" placeholder="pick a date" />
    </div>
    <div>
    <button md-button click.delegate="setTime()">set time</button>
    7 changes: 3 additions & 4 deletions app.js
    Original file line number Diff line number Diff line change
    @@ -1,8 +1,7 @@
    export class App {
    selectedDate = null;
    time = null;

    setDate() {
    let date = new Date();
    this.selectedDate = date;
    setTime() {
    this.time = "07:13";
    }
    }
  6. Thanood revised this gist Jun 26, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion app.html
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    <template>
    <div>
    <input md-timepicker type="date" placeholder="pick a date" />
    <input md-timepicker placeholder="pick a date" />
    </div>
    <div>
    <button md-button click.delegate="setTime()">set time</button>
  7. Thanood created this gist Jun 26, 2017.
    12 changes: 12 additions & 0 deletions _tips.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    #### tab targetting

    To enable the datepicker to become a valid tab target (as in: responds to the correct tab order),
    set the container to be the parent of the datepicker input. Like this:

    ```js
    <div ref="dpWrapper">
    <input md-datepicker="container.bind: dpWrapper; value.two-way: selectedDate;" type="date" placeholder="pick a date" />
    </div>

    ```

    11 changes: 11 additions & 0 deletions app.html
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    <template>
    <div>
    <input md-timepicker type="date" placeholder="pick a date" />
    </div>
    <div>
    <button md-button click.delegate="setTime()">set time</button>
    </div>
    <div>
    <span if.bind="selectedTime">You selected (UTC time): ${selectedTime | stringify}</span>
    </div>
    </template>
    8 changes: 8 additions & 0 deletions app.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    export class App {
    selectedDate = null;

    setDate() {
    let date = new Date();
    this.selectedDate = date;
    }
    }
    16 changes: 16 additions & 0 deletions index.html
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,16 @@
    <!doctype html>
    <html>
    <head>
    <title>Aurelia</title>
    <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    </head>
    <body aurelia-app="main">
    <h1>Loading...</h1>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.6/system.js"></script>
    <script src="https://rawgit.com/aurelia-ui-toolkits/aurelia-materialize-bundles/0.20.2/config2.js"></script>
    <script>
    System.import('aurelia-bootstrapper');
    </script>
    </body>
    </html>
    20 changes: 20 additions & 0 deletions main.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@
    /*******************************************************************************
    * The following two lines enable async/await without using babel's
    * "runtime" transformer. Uncomment the lines if you intend to use async/await.
    *
    * More info here: https://github.com/jdanyow/aurelia-plunker/issues/2
    */
    //import regeneratorRuntime from 'babel-runtime/regenerator';
    //window.regeneratorRuntime = regeneratorRuntime;
    /******************************************************************************/

    import 'materialize';

    export function configure(aurelia) {
    aurelia.use
    .standardConfiguration()
    .developmentLogging()
    .plugin('aurelia-materialize-bridge', bridge => bridge.useAll() );

    aurelia.start().then(a => a.setRoot());
    }