-
Notifications
You must be signed in to change notification settings - Fork 724
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
editionView() returns date decremented by 1 day #1271
Comments
It's perhaps a timezone issue. Have you tried with different timezones, or with UTC? |
Yes, I checked the timezone before entering the issue and it is set correctly.
… On Dec 9, 2016, at 9:21 AM, Kmaschta ***@***.***> wrote:
It's perhaps a timezone issue. Have you tried with different timezones, or with UTC?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub <#1271 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AEWhYCI0YAXKa7Unx_FmlqJwBaNaBBsDks5rGXHkgaJpZM4LIB3J>.
|
Can you provide a Plunkr that reproduce the issue, following the issue template? |
As requested, Plunkr updated earlier this week.
… On Dec 9, 2016, at 10:40 AM, Kmaschta ***@***.***> wrote:
Can you provide a Plunkr that reproduce the issue, following the issue template <https://github.com/marmelab/ng-admin/blob/master/ISSUE_TEMPLATE.md>?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub <#1271 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AEWhYNqR_wBKlnl0oT31A-wQdVBgiQDzks5rGYSbgaJpZM4LIB3J>.
|
Your Plunkr aims the url |
It is not down. I can access it. Route from Plunkr?
…-- Scott
On Dec 15, 2016, at 7:56 AM, Kmaschta ***@***.***> wrote:
Your Plunkr aims the url http://dashboard.globalvetlink.com which is down.
You need to make it works in a standalone way.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
specifically if you browse to http: http://dashboard.globalvetlink.com/projects <http://dashboard.globalvetlink.com/projects> it will return the JSON response of all the projects
… On Dec 15, 2016, at 7:56 AM, Kmaschta ***@***.***> wrote:
Your Plunkr aims the url http://dashboard.globalvetlink.com which is down.
You need to make it works in a standalone way.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub <#1271 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AEWhYNvJ0-rV-XXVNjf0E-z5u9mwYL7gks5rIUcVgaJpZM4LIB3J>.
|
I also get a 404 error. This is due to a cross origin problem
|
Thanks Greg.
I knew about the 'Access-Control-Expose-Headers: x-total-count’ but didn’t realize the 'Access-Control-Allow-Origin' header should be present. It is now.
And I’m able to reproduce the problem with the date decrementing by following the steps I posted by selecting project #66.
… On Dec 15, 2016, at 10:06 AM, Greg ***@***.***> wrote:
I also get a 404 error. This is due to a cross origin problem
XMLHttpRequest cannot load http://dashboard.globalvetlink.com/projects?_end=30&_order=DESC&_sort=id&_start=0 <http://dashboard.globalvetlink.com/projects?_end=30&_order=DESC&_sort=id&_start=0>. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://run.plnkr.co <http://run.plnkr.co/>' is therefore not allowed access.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub <#1271 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AEWhYCxnC_BdjHStCEhNiRxvZmKiMs32ks5rIWWbgaJpZM4LIB3J>.
|
Maybe its just me being tired, but I dont see the issue.
So the displayed date is the same as the payload devdate (?). |
I agree with the first three bullets. It is the Development Date that I get 12-06-2016. If it was only a browser display issue, why would the data be changed? If I save this, without changing anything, the next payload for “devdate" will be 12-06-2016. Also, if it was a GMT issue wouldn’t it return 12-08-2016 since I’m 6 hours behind GMT (and after 6pm but before midnight)?
Here is a screen shot:
![image](https://cloud.githubusercontent.com/assets/1819833/21321805/aa6f1bce-c616-11e6-893d-07e4a2313d16.png)
Thanks for your assistance.
|
Cannot see your screenshot. On your current plunker, every date displayed, on the listview or on the individual edit views, are exactly the date received inside the response payload:
|
I edited the previous post, it is a jpeg. Hopefully you will be able to see the same thing I’m seeing.
… On Dec 15, 2016, at 2:03 PM, Greg ***@***.***> wrote:
Cannot see your screenshot.
On your current plunker, every date displayed, on the listview or on the individual edit views, are exactly the date received inside the response payload:
[{"id":"66","projname":"Feline","owner":"Jan Johnson","description":"Today's New York Times features the story Holly the Cat, a Florida feline who traveled nearly 200 miles to get home. Ms. Johnson's cat is now famous.","devdate":"2016-12-07","stage":"Development and Beta","parked":true},{"id":"61","projname":"Canine","owner":"Mark Anderson","description":"The Spinone Italiano is an Italian dog breed. It was originally bred as a versatile gun dog. To this day, the breed still masters that purpose. The Spinone is a loyal, friendly and alert dog with a close lying, wiry coat.","devdate":"2016-12-08","stage":"Full Commercialization","parked":false},{"id":"18","projname":"Poultry","owner":"Mark Anderson","description":"\"Poultry\" means chickens, turkeys, domestic waterfowl, ratites, and domestic game birds, except doves and pigeons.","devdate":"2016-12-06","stage":"Development and Beta","parked":false},{"id":"4","projname":"Equine","owner":"Mark Anderson","description":"Certificate of Veterinary Inspection (CVI). All equine imported into the state of Iowa shall be accompanied by a CVI.","devdate":"2016-09-04","stage":"Feasibility & Planning","parked":true},{"id":"3","projname":"Cattle","owner":"Jan Johnson","description":"Recognized slaughter establishment means a slaughtering establishment operating under the\r\nprovisions of either the Federal Meat Inspection Act (21 U.S.C. 601 et seq.) or an equivalent state meat\r\ninspection program.","devdate":"2016-10-28","stage":"Concept Development","parked":true},{"id":"1","projname":"Swine","owner":"Jan Johnson","description":"Transitional swine means swine that have been, or have had the potential to be, exposed to feral swine.","devdate":"2016-10-30","stage":"Idea Generation","parked":false}]
<https://cloud.githubusercontent.com/assets/724262/21240044/dc4e7776-c309-11e6-8ff5-b4fe52a0a50b.png>
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub <#1271 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AEWhYG-z_JyugFTl8kEcAxrkTbOvnhymks5rIZ0NgaJpZM4LIB3J>.
|
Ok for the screenshot, but what is the payload you actually receive in the browser. Check in the developper console in Chrome (CTRL+SHIFT+I). You may try to adapt the display date (#1091) or play with the [datepicker config] (https://angular-ui.github.io/bootstrap/) |
I set my computer TZ to France and it works as expected. You are on correct about the payload received by the browser and it being tied to the region setting of the browsers (multiple browsers have the problem). I’ll try to adapt the display date first.
For completeness, I experimented with changing to almost all the timezones of the world and there is a clear pattern. GMT, GMT +1, GMT +2, ..., GMT +14 all work as expected. Setting timezones to GMT -1, GMT -2, GMT -3, ..., GMT -12 all display the date minus one day.
… On Dec 16, 2016, at 9:37 AM, Greg ***@***.***> wrote:
Ok for the screenshot, but what is the payload you actually receive in the browser. Check in the developper console in Chrome (CTRL+SHIFT+I).
If it is "2016-12-07", then as you can see in my screenshot , it is definitaly a regional setting problem. This is probably gthe case because when you save you are saying that it is the correct date..so probably the JSON paylod of the POST or PUT is also correct, even though displayed wrong
You may try to adapt the display date (#1091 <#1091>) or play with the [datepicker config] (https://angular-ui.github.io/bootstrap/ <https://angular-ui.github.io/bootstrap/>)
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub <#1271 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AEWhYO9l87L1MAU8PhEP0IsoPHmgKlgZks5rIk22gaJpZM4LIB3J>.
|
I tried adapting the display date (#1091) but it appears that the transform(dateFormatting) happens after the datepicker displays the wrong date. It leaves me with only the datepicker config. |
Changing the datepicker config will not address the issue either. I traced the code down and the #devDate value is "2016-12-06" before the input-group datepicker class is called. As we have already established, the devDate is correct ("2016-12-07") coming from the API in the browser and also correct in the creationView. My best guess is it is getting changed by ng-admin-field-devDate. |
I'm experiencing a similar problem with my Datepicker field, the value field is inconsistent with what I selected. I selected January 1, 2015, the field value changed to June 21, 2015. I'm also getting "Error: 10 $digest() iterations reached." in my console log. The later error could be my app specific. I pinpointed the error down to these codes. My $digest error disappeared when I commented out the $watch statement.
The solution that I came up with is to unregister $watch() instead of return inside the IF conditions. Replace the above statement with these codes.
@wannarka @Phocea @Kmaschta @fzaninotto Can you please confirm the fixed and merge it to master? It is a critical bug. |
I experienced the same issue with the Datepicker field and thachp's solution worked for me! @thachp Kudos! |
@thachp its a bit difficult to verify this in our timezone. In any case, could you please create a PR with your changes so the whole team can have a look ? |
@thachp <https://github.com/thachp> I’ll be happy to validate the fix with my app. I have the maDateField.js file updated on my server but not sure what to do next. How do I get ng-admin updated to use the change?
… On Feb 5, 2017, at 6:57 AM, Patrick Thach ***@***.***> wrote:
I'm experiencing a similar problem with my datepicker field. Beside getting the incorrect date on select, I'm also getting "Error: 10 $digest() iterations reached." The error could be my app specific.
I pinpointed the error down to these codes. My $digest error disappeared when I commented out the $watch statement.
// maDateField.js LINE 30
scope.$watch('value', function (newValue, oldValue) {
if (newValue === oldValue) {
return;
}
if (!newValue) {
scope.rawValue = null;
return;
}
scope.rawValue = scope.value instanceof Date ? scope.value : new Date(scope.value);
});
The solution that I came up with is to unregister $watch() instead of return inside the IF conditions. Replace the above statement with these codes.
var $watchValue = scope.$watch('value', function (newValue, oldValue) {
if (newValue === oldValue) {
$watchValue();
}
if (!newValue) {
scope.rawValue = null;
$watchValue();
}
scope.rawValue = scope.value instanceof Date ? scope.value : new Date(scope.value);
});
@wannarka <https://github.com/wannarka> @Phocea <https://github.com/Phocea> Can you please confirm the fixed and the merge it to master? It is a critical bug.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#1271 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AEWhYBDsLgSAXQXtM9ICZzhOHlerzm8Lks5rZcdWgaJpZM4LIB3J>.
|
This workaround may help here: |
Okay, I just fixed an issue with the DateField. Let's try it again when the #1318 will be published. |
It seems fixed with the I close this issue, feel free to open it again if needed and share your feedback. |
I tried the Plunkr linked and 1.0.1 does NOT fix the issue. In the Project List view you will see a ‘Next Review Date’. If you edit a project with a date set, it will display the previous day in any timezone where GMT minus 1-8. See my previous comments. This is easily replicated by setting your computer’s clock to a timezone in the USA.
… On Mar 8, 2017, at 10:26 AM, Kmaschta ***@***.***> wrote:
It seems fixed with the 1.0.1 as you can see on this Plunkr <http://plnkr.co/edit/89xkfpjECnslVmhBenRB?p=preview>.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#1271 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AEWhYD8N9LG9c71cQGqRKWgcM99JehSxks5rjtbDgaJpZM4LIB3J>.
|
I am not able to reproduce, even with a timezone in the USA. Can you give me more detailed infos about the bug? |
It would probably help to make the current code public http://plnkr.co/edit/e6xFoK?p=preview <http://plnkr.co/edit/e6xFoK?p=preview>
In the project list, take note of the Otis and/or VL Auto Sign Up `Next Review Date`. Edit either project and you will notice the date has been decremented by one day in the field box next to `Next Review Date` when a USA timezone is used. I can do a screen capture if the link doesn’t show it.
… On Mar 9, 2017, at 10:20 AM, Kmaschta ***@***.***> wrote:
I am not able to reproduce, even with a timezone in the USA.
If I click on the 3rd March, the input will be filled with 2017-03-03.
I don't find a field named Next Review Date either.
Can you give me more detailed infos about the bug?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#1271 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AEWhYIjFIgzdVZNCVxlzOlEALpg63LSFks5rkCa5gaJpZM4LIB3J>.
|
Okay, better! I was able to reproduce the bug until I type Can you confirm? |
I emptied the cache and did a hard reload and I still see the problem. I also can reproduce with both Chrome and Safari.
… On Mar 9, 2017, at 11:13 AM, Kmaschta ***@***.***> wrote:
Okay, better!
I was able to reproduce the bug until I type Ctrl + F5.
I suspect a cache issue, because I'm unable again to reproduce the error.
Can you confirm?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#1271 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AEWhYFF4P8x0v6IOupsEZerGg8QYA0ytks5rkDMsgaJpZM4LIB3J>.
|
Indeed, I'm GMT-5 and I see a different Date on showView and editView. IMHO the field needs to adjust the timezone to avoid modifications on the original value by the javascript's |
hi @Phocea , I'm experiencing with DateField infinite watches loop in EditionView ( |
Description
In my index.js:
The day (dd) is decremented by 1 but the above works fine (displays the correct
devdate
response) inproject.creationView().fields
.Steps to Reproduce
Plunkr: http://plnkr.co/edit/M70PbzPLBCGVZ9dollvj?p=preview
I've tried it with and without the
.format
and.label
with the same results. Again, creationView works just fine. And the datepicker requests with thedevdate:"2016-12-08"
so it is stored in the database accurately.Expected behavior: Display 12-07-2016
Actual behavior: Displays 12-06-2016
The text was updated successfully, but these errors were encountered: