Title: Add support for a 'unixepoch' form of Date (patch included) · Issue #11 · google/google-visualization-python · GitHub
Open Graph Title: Add support for a 'unixepoch' form of Date (patch included) · Issue #11 · google/google-visualization-python
X Title: Add support for a 'unixepoch' form of Date (patch included) · Issue #11 · google/google-visualization-python
Description: Please consider adding support for a Unix Epoch form of Date (unixepoch), as used by sqlite3. This is very handy for sysadmin-type stuff, and I'm already using a modified version of the Python library supporting it. Here is a context dif...
Open Graph Description: Please consider adding support for a Unix Epoch form of Date (unixepoch), as used by sqlite3. This is very handy for sysadmin-type stuff, and I'm already using a modified version of the Python libr...
X Description: Please consider adding support for a Unix Epoch form of Date (unixepoch), as used by sqlite3. This is very handy for sysadmin-type stuff, and I'm already using a modified version of the Python ...
Opengraph URL: https://github.com/google/google-visualization-python/issues/11
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Add support for a 'unixepoch' form of Date (patch included)","articleBody":"```\nPlease consider adding support for a Unix Epoch form of Date (unixepoch), as \nused by sqlite3. This is very handy for sysadmin-type stuff, and I'm already \nusing a modified version of the Python library supporting it.\n\nHere is a context diff showing how to implement it:\n\n*** google-visualization-python/gviz_api.py Thu Oct 8 06:00:05 2009\n--- with-unixepoch-support/gviz_api.py Mon Oct 18 17:08:11 2010\n***************\n*** 185,192 ****\n\n Args:\n value: The value which should be converted\n! value_type: One of \"string\", \"number\", \"boolean\", \"date\", \"datetime\" or\n! \"timeofday\".\n escape_func: The function to use for escaping strings.\n\n Returns:\n--- 185,192 ----\n\n Args:\n value: The value which should be converted\n! value_type: One of \"string\", \"number\", \"boolean\", \"date\", \"datetime\",\n! \"timeofday\" or \"unixepoch\".\n escape_func: The function to use for escaping strings.\n\n Returns:\n***************\n*** 264,269 ****\n--- 264,274 ----\n raise DataTableException(\"Wrong type %s when expected time\" % t_value)\n return \"[%d,%d,%d]\" % (value.hour, value.minute, value.second)\n\n+ elif value_type == \"unixepoch\":\n+ if not isinstance(value, (int, long)):\n+ raise DataTableException(\"Wrong type %s when expected seconds since \nunix epoch\" % t_value)\n+ return \"new Date(%d)\" % (value*1000)\n+\n elif value_type == \"datetime\":\n if not isinstance(value, datetime.datetime):\n raise DataTableException(\"Wrong type %s when expected datetime\" %\n***************\n*** 335,341 ****\n if len(description) > 4:\n raise DataTableException(\"Description error: tuple of length > 4\")\n if desc_dict[\"type\"] not in [\"string\", \"number\", \"boolean\",\n! \"date\", \"datetime\", \"timeofday\"]:\n raise DataTableException(\n \"Description error: unsupported type '%s'\" % desc_dict[\"type\"])\n return desc_dict\n--- 340,346 ----\n if len(description) > 4:\n raise DataTableException(\"Description error: tuple of length > 4\")\n if desc_dict[\"type\"] not in [\"string\", \"number\", \"boolean\",\n! \"date\", \"datetime\", \"timeofday\", \n\"unixepoch\"]:\n raise DataTableException(\n \"Description error: unsupported type '%s'\" % desc_dict[\"type\"])\n return desc_dict\n```\n\nOriginal issue reported on code.google.com by `Warren.H...@gmail.com` on 20 Oct 2010 at 2:52\n","author":{"url":"https://github.com/GoogleCodeExporter","@type":"Person","name":"GoogleCodeExporter"},"datePublished":"2015-05-05T18:26:14Z","url":"https://github.com/google/google-visualization-python/issues/11"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:402a8226-59b1-a572-9631-5efcfd950799 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8FCE:34DB8F:15BC966:1D054C9:6B013EAF |
| html-safe-nonce | 9053df94f6524af90e19976e23f5eb07602db52a626f103d9bb2c95d8751cb62 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RkNFOjM0REI4RjoxNUJDOTY2OjFEMDU0Qzk6NkIwMTNFQUYiLCJ2aXNpdG9yX2lkIjoiMTQ0MDk3MDI2MTI3MTc1NjQ2MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | abd098d8d7ce6bef154ec6ca59dd1a39ae78cd07a191afae29cf4fb614586b9e |
| hovercard-subject-tag | issue:73390663 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/google/google-visualization-python/11/issue_layout |
| twitter:image | https://opengraph.githubassets.com/4e76b990063157abf812882e75e47d2fde2ca536883335183d6ccaba001c2f75/google/google-visualization-python/issues/11 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/4e76b990063157abf812882e75e47d2fde2ca536883335183d6ccaba001c2f75/google/google-visualization-python/issues/11 |
| og:image:alt | Please consider adding support for a Unix Epoch form of Date (unixepoch), as used by sqlite3. This is very handy for sysadmin-type stuff, and I'm already using a modified version of the Python libr... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | GoogleCodeExporter |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/google/google-visualization-python git https://github.com/google/google-visualization-python.git |
| octolytics-dimension-user_id | 1342004 |
| octolytics-dimension-user_login | |
| octolytics-dimension-repository_id | 35116715 |
| octolytics-dimension-repository_nwo | google/google-visualization-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 35116715 |
| octolytics-dimension-repository_network_root_nwo | google/google-visualization-python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width