Closed allenmichael099 closed 3 years ago
@shankari @asiripanich As far as I can tell, this is now ready to go. Checkinout objects get deleted based on objectId, and the formatted time still displays correctly.
If in future edits to this feature you find the problem below, it is probably because the target indices within columnDefs got shifted out of place.
this feature you find the problem below, it is probably because the target indices
I personally don't like this workaround. Maybe DTedit is a bad choice to begin with. However, I'm going to merge it to allow this feature to exist. But it will most likely be removed when I do a major update to the dashboard.
@asiripanich I don't know that the problem is with DTedit; the problem is with making the call to the database to delete the entry. We will have to solve something similar for the user status editing anyway.
@allenmichael099 could you please explain why you need this? I know it is not part of this PR but seems related to this.
@asiripanich The code snippet above is so we will render a human readable time next to the timestamp every time a supplementary table has a column called 'ts'.
@asiripanich The code snippet above is so we will render a human readable time next to the timestamp every time a supplementary table has a column called 'ts'.
Can we convert this timestamp to a proper datetime field during the 'load data' step?
@asiripanich we tried using datetime, but since the conversion happens in R, it converts based on the timezone of the server, which for AWS is UTC. So instead of the user seeing the datetime in their local timezone, they will see it in UTC, and have to do the conversion in their head.
With this option, we convert the timestamp on the browser instead.
Switched to object ID to identify which Checkinout entry to delete. It used to use user_id, but that did not delete database entries because it was not converted to BSON before querying. I couldn't find a way to convert it to BSON or a way to query with BSON in mongolite.