Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="Mithril with Rome date picker">
  <meta charset="utf-8">
  <title>JS Bin</title>
  <link href="http://bevacqua.github.io/rome/dist/rome.css" rel="stylesheet" type="text/css">
  <script src="https://cdn.rawgit.com/lhorie/mithril.js/next/mithril.js"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.10.3/moment.min.js"></script>
  <script src="http://bevacqua.github.io/rome/dist/rome.standalone.js"></script>
</head>
<body>
</body>
</html>
 
var app = {};
app.model = {
  date: m.prop(new Date())
};
app.view = function(ctrl) {
  return m('input',
    {
      type: 'text',
      config: function(el, inited, context) {
        if (inited) return;
        var instance = rome(el, {
          initialValue: app.model.date()
        });
        instance.on('data', function(value) {
          app.model.date(this.getMoment());
        })
      }
    }
  );
};
m.mount(document.body, app);
Output 300px

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
ArthurClemenspro
0viewers