Skip to content
This repository was archived by the owner on Nov 16, 2018. It is now read-only.

Commit 24b7d30

Browse files
committed
Merge branch 'malliapi-ExamplesAndBuildFix'
Closes #34
2 parents d58d3db + 98520b2 commit 24b7d30

File tree

6 files changed

+68
-18
lines changed

6 files changed

+68
-18
lines changed

examples/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
1. Clone this repo
44
2. Run npm install
55
3. Start dev server with `npm run examples`
6-
4. Browse `http://localhost:8080
6+
4. Browse `http://localhost:8080`

examples/basic/basic.jsx

Lines changed: 48 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,55 @@ var DateTimeField = require('react-bootstrap-datetimepicker');
33

44
var Basic = React.createClass({
55

6-
render () {
7-
return <DateTimeField />;
8-
}
6+
render: function() {
7+
return <div className="container">
8+
<div className="row">
9+
<div className="col-xs-12">
10+
<h1>React Bootstrap DateTimePicker</h1>
11+
This project is a port of <a href="https://github.com/Eonasdan/bootstrap-datetimepicker">https://github.com/Eonasdan/bootstrap-datetimepicker</a> for React.js
12+
</div>
13+
</div>
14+
<div className="row">
15+
<div className="col-xs-12">
16+
Default Basic Example
17+
<DateTimeField />
18+
<pre> {'<DateTimeField />'} </pre>
19+
</div>
20+
</div>
21+
<div className="row">
22+
<div className="col-xs-12">
23+
Example with default Text
24+
<DateTimeField
25+
defaultText="Please select a date"
26+
/>
27+
<pre> {'<DateTimeField defaultText="Please select a date" />'} </pre>
28+
</div>
29+
</div>
30+
<div className="row">
31+
<div className="col-xs-12">
32+
ViewMode set to years view with custom inputFormat
33+
<DateTimeField
34+
inputFormat='DD-MM-YYYY'
35+
viewMode='years'
36+
/>
37+
<pre> {'<DateTimeField viewMode="years" inputFormat="DD-MM-YYYY" />'} </pre>
38+
</div>
39+
</div>
40+
<div className="row">
41+
<div className="col-xs-12">
42+
daysOfWeekDisabled
43+
<DateTimeField
44+
daysOfWeekDisabled={[0,1,2]}
45+
/>
46+
<pre> {'<DateTimeField daysOfWeekDisabled={[0,1,2]} />'} </pre>
47+
48+
</div>
49+
</div>
50+
</div>;
51+
}
952

1053
});
1154

55+
56+
1257
React.render(React.createFactory(Basic)(), document.getElementById('example'));

examples/basic/index.html

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,18 @@
33
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet">
44
<link href="../bootstrap-datetimepicker.min.css" rel="stylesheet">
55
<body>
6-
<div style="width: 300px; position: relative;">
6+
<style>
7+
.container {
8+
max-width: 500px;
9+
margin-left:auto;
10+
margin-right:auto;
11+
}
12+
13+
.row {
14+
padding-top: 50px;
15+
}
16+
</style>
17+
<div>
718
<div id="example" />
819
</div>
920
<script src="/basic.js"></script>

examples/webpack.config.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
var HtmlWebpackPlugin = require('html-webpack-plugin');
2+
13
module.exports = {
24

35
entry: {
@@ -31,6 +33,9 @@ module.exports = {
3133
stats: {colors: true},
3234
},
3335

34-
devtool: "eval-source-map"
36+
devtool: "eval-source-map",
37+
plugins: [new HtmlWebpackPlugin({
38+
template: __dirname + '/basic/index.html'
39+
})]
3540

3641
};

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
"grunt-contrib-watch": "~0.5.3",
4141
"grunt-react": "~0.10.0",
4242
"grunt-shell": "~0.6.4",
43+
"html-webpack-plugin": "^1.1.0",
4344
"jsx-loader": "^0.12.2",
4445
"react": ">=0.12",
4546
"react-tools": "^0.12.2",

test/coffee/DateTimePickerHoursSpec.jsx.coffee

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)