Bigcommerce Product API update preorder_release_date - api

What is the proper syntax for updating a product's pre-order release date through the API?
I've tried it this way:
{"preorder_release_date":"Wed, 05 Oct 2016 05:00:00 +0000"}
And while that passes through validation, all it ends up doing is clearing out whatever value was formerly in the field without actually setting it to the correct date.

Related

React Table shows entries based on User Time zone not UTC

I have a table (react/Nodejs) which reads the entries from db and list it in the table. All entries in db are UTC, however depending on the user time zone the table is showing different data. For example in the attached snapshot our week on header is from Sep 19 to Sep 25 but the table shows Sep 26 entry which is outside of the range. That only happens with users on (UTC-xxx) time and not for user on (UTC+xxx). Your help is appreciated? Table Image
Use a timezone library to render it with a specific timezone
The problem is caused when formatting the object to be rendered in the UI, so probably the method you are using is as you say taking into account the users timezone and not a specific one that you set.
To achieve this, you can use a library like moment timezone. Or a variant compatible with your libraries.
Hope it helps.

Why is Amazon's Vendor Central API not giving POs changed on a certain date?

I'm using Amazon's Vendor Central API to find all purchase orders changed on a given date. The API runs fine, but it seems to be excluding some results. Can someone tell me what I'm missing?
Example:
I want to know of any POs changed on 12/10. I know PO 8ZTZJAZD was changed on that date because if I search for the specific PO I get a changed date of 12/10:
However, when I run the API for any POs on 12/10, I don't get any results:
Why does a record clearly changed on 12/10 not coming up when I ask for all records changed after 12/10 12 a.m. and before 12/10 11:59 p.m.?
As of March 2021, the whole vendor central/direct fulfillment API system is extremely delicate and riddled with bugs, this is unfortunately just something you'll have to deal with using business logic.

Issue with Rally custom list with deep export (bug)

I am using Rally "Custom list With Deep export"
We have a field Planned end date. How ever while exporting it gives the result for next day in CSV format.
e.g: If the date is 31 December 2019 in Rally then in CSV it shows as 1 January 2020. Is it intended behavior? or a bug
Hmmm, is this related to the timezone that you are in? If your workspace timezone is different from your machine timezone, it can throw up oddities like this.
The app might not be timezone aware.

How to set Paging for Xero's Payment API?

There doesn't seem be an option to set the page quantity in the Payment endpoint for the GET method. I need to pull the data from every line item within a payment, but cannot see a workaround. Has anyone else come up with a solution?
Hi #Casey and welcome to SO!
According to Xero (source):
You can use pagination to retrieve line item details for 100 items
(e.g. Invoices) at a time. Endpoints on the Accounting API that
currently support pagination are invoices, contacts, bank transactions
and manual journals. All major endpoints on the Payroll, Files and
Assets APIs also support paging. Use the If-Modified-Since header to
retrieve only what's changed since your previous request
However, regarding Payments, Xero's API documentation mentions how to filter or sort results but not how to paginate them, very surprising. Back in 2012 they officially confirmed this was not supported and considered it as a Feature Request.
Here's a potential solution:
I would use the 4th example in the Retrieving a filtered set of resources using the “where” parameter section here: https://developer.xero.com/documentation/api/requests-and-responses and build a pagination myself using date ranges.
Date >= DateTime(2019, 01, 01) && Date < DateTime(2019, 01, 02)
Date >= DateTime(2019, 01, 02) && Date < DateTime(2019, 01, 03)
etc.
You might also consider achieving this using the Reference variable (assuming it has numerical values) which is available in the Payments GET request too.
I hope this helps!

Timezone-affected rails 3 app

UPDATE:
Copied from comment made below:
I thought about using a web service against IP address for each visitor to the site but then I wondered about users looking at meetings in locations that span timezones so the timezone has to be associated with the location of the meeting being viewed, not where the user themselves are at that moment in time. I need a user to be able to see a list of meetings (with times and locations) and the times shown are the actual meeting times but the WHERE clause of the SELECT to list the meetings needs to take into account the timezone of each meeting location.
I've looked around and there are plenty of questions asked about using timezones with a rails app.
The issue lies in the fact that the app needs to know which timezone a user is in for it to properly be able to run queries against the database to check for datetimes in the future, for instance.
I don't want regular visitors to my site to need to login for it to work correctly for them so I'm thinking along the following lines:
Admin users login to post an item for a particular location and datetime
When saving the item it uses the [lat,lng] of the location to call the Timezone gem to capture the timezone for the location
I think I need this timezone to be added to an extra field on the same model as the [lat,lng] and the datetime (which rails saves as UTC) ( https://stackoverflow.com/a/2533323 )
I need my model to combine the UTC datetime with its respective timezone so that when a regular user comes to the site the webpage selects items where the UTC+timezone datetimes are in the future
Does that sound possible/correct?
If it sounds confusing just say in a comment and I'll try to reword it a bit better if I can.
Can someone offer any code for the model to create a virtual attribute (I think) that combines UTC datetime with a timezone field?
Thanks
Won't it be better to have the list of countries and their timezones? When user comes to site determine from what country he is and than trying to use native rails timezone methods.
For example I have User and Table models that have created_at params:
Time.zone => (GMT+00:00) UTC
User.last.created_at => Mon, 25 Jun 2012 21:17:25 UTC +00:00
Table.last.created_at => Mon, 16 Jul 2012 14:08:17 UTC +00:00
Time.zone = 'Moscow' => "Moscow"
Time.zone => (GMT+04:00) Moscow
User.last.created_at => Tue, 26 Jun 2012 01:17:25 MSK +04:00
Table.last.created_at => Mon, 16 Jul 2012 18:08:17 MSK +04:00
How to determine the country you should look for gems or some services. I think it will be the service that determine the user country by his IP address.