/src/mui/field/DateField.spec.js#18, /src/mui/field/DateField.spec.js#28 and /src/mui/field/DateField.spec.js#38 the test may fail because of the timezone. By default a date is set on 00:00:00. My timezone is UTC-3 so on the DateField tests the time shows the wrong date (previous day at 21:00:00).
Also it asked for aor-json-rest-client, aor-language-french and aor-rich-text-input when running the tests. Is something missing on package.json?
cd example/
npm i
I think the test uses example app so the above commands fix the lib errors
@valueshimoda indeed the dependencies were fixed when running the command above. But the date field issue still happens.
Strange, these tests manipulate dates, not datetimes. Can you paste the results of these tests on your computer?
@fzaninotto Will do it today. The problem is that it sets the Locale. When setting the locale it applies the timezone too. As I'm UTC-3 and it uses US timezone (UTC-6 I believe) setting the locale makes it shift back 3 hours.
1) <DateField /> should render a date:
AssertionError: '<span>4/22/2017</span>' == '<span>4/23/2017</span>'
+ expected - actual
-<span>4/22/2017</span>
+<span>4/23/2017</span>
at Context.<anonymous> (src/mui/field/DateField.spec.js:17:45)
2) <DateField /> should pass the options prop to Intl.DateTimeFormat:
AssertionError: '<span>Saturday, April 22, 2017</span>' == '<span>Sunday, April 23, 2017</span>'
+ expected - actual
-<span>Saturday, April 22, 2017</span>
+<span>Sunday, April 23, 2017</span>
at Context.<anonymous> (src/mui/field/DateField.spec.js:27:76)
3) <DateField /> should use the locales props as an argument to Intl.DateTimeFormat:
AssertionError: '<span>22/04/2017</span>' == '<span>23/04/2017</span>'
+ expected - actual
-<span>22/04/2017</span>
+<span>23/04/2017</span>
at Context.<anonymous> (src/mui/field/DateField.spec.js:37:91)
and then I added on line 18 the following:
const date = new Date('2017-04-23');
console.log(date);
console.log(date.toLocaleString('en-US', {}));
console.log(date.toLocaleString());
console.log(date.toLocaleDateString('en-US', {}));
console.log(date.toLocaleDateString());
and got this output:
2017-04-23T00:00:00.000Z
4/22/2017, 9:00:00 PM
4/22/2017, 9:00:00 PM
4/22/2017
4/22/2017
Now. if I set the hours:
const date = new Date('2017-04-23 13:00:00');
console.log(date);
console.log(date.toLocaleString('en-US', {}));
console.log(date.toLocaleString());
console.log(date.toLocaleDateString('en-US', {}));
console.log(date.toLocaleDateString());
````
then
2017-04-23T16:00:00.000Z
4/23/2017, 1:00:00 PM
4/23/2017, 1:00:00 PM
4/23/2017
4/23/2017
```
and the test passes.


Hi, using either timestamp with time zone or date I get the wrong day with DateField. You can see the string I get from my data provider on the TextField column and how the filter does work.
I am still facing the same issue. Date displays a day back.