Comments (19)
Happy to review a PR, but for now I'll focus on plugging the existing code into tibble.
from pillar.
Yeah exactly - and a separate function would be fine.
from pillar.
No worries, that's fine.
from pillar.
I don't know of a good (even approximate) way of generating the UTC offset. (Also need to remember that some time zones have partial hour offsets)
from pillar.
RcppCCTZ maybe?
from pillar.
Assuming RcppCCTZ meets the needs, I think the partial-hour problem could be overcome by using something like:
<dttm-03:30/-02:30>
2015-06-01 01:00:00
which would just fit.
I think the "range" of the offsets offered could be limited to the date-times being considered in the given column.
On the one hand, this would limit the printing of dual-offset headers to those cases where both offsets appear in the tibble. On the other hand, that would seem to make it harder to format consistently for normal and daylight-saving offsets.
from pillar.
And over long periods of time, I bet only two offsets is insufficient
from pillar.
If I'm reading the conversation correctly it sounds like this feature, though potentially useful, has edge cases that make things sufficiently difficult so as to outweigh the benefits.
I'll close the issue in the hopes that I will be able to do some twiddling myself.
If I come up with something worth talking about, I'll be happy to reopen and make a PR, even if only for the entertainment value ;)
If you (@hadley or @krlmlr) think this is worth keeping open, you'll not offend me by re-opening.
from pillar.
I think we could just add the time zone verbatim: Date-times use 19 characters anyway, most time zone descriptors (known to my system) are 14 characters or shorter:
quantile(nchar(OlsonNames()))
#> 0% 25% 50% 75% 100%
#> 2 12 14 17 32
This means using <dt-...>
as column type will display the time zone in full for half of the time zones, and it will be abbreviated automatically (and occupy only 19 spaces) if too wide. Thoughts?
from pillar.
Olson names are probably amenable to human shortening - split in two pieces, manually abbreviate first and then call abbreviate()
on the second? (Use ... if there's three pieces?)
from pillar.
@ijlyttle: Would you like to take a stab?
from pillar.
@krlmlr: I would like to - first, let me look and see to make sure I can get my level-of-understanding where it needs to be to contribute.
from pillar.
I had a look, and I think I understand the idea - at its core, we would want a function that would take an Olson string, then return an abbreviated string of no more than 14 characters. Something like:
#' Abbreviate an Olson timezone to 14 characters
abbreviate_olson <- function(x) {
}
Then, you could take returned string and embed it into <dt-...>
, which would be a maximum of 19 characters.
Alternatively, such a function could return all (max) 19 characters.
I don't know if you will want this in its own function or not, but it will give me a place to start.
Let me see what I can do here.
from pillar.
Just a heads-up that I don't think I can get to this until the end-of-the week (2017-09-16). I am eager to do it, but I don't want to be blocking things either.
from pillar.
hello there! I am just wondering, what about DST time changes? I mean, assume I print something between midnight and 5am on a DST day, the column header will be wrong, right? Can you possibly print some additional stuff? Like an asterisk or something that indicates this is a DST day?
from pillar.
As I understand it, the column header will refer to a time zone that is fixed to a geography, i.e. "America/New_York"
, which will not change if it is DST (or not).
How to address the significance of values for which DST is in effect would be a separate question, IMHO.
from pillar.
huuuum the more I think about it, the more printing the offset seems dead wrong.... The header will be likely to be wrong whenever the data encompasses a DST switch - which is very likely. Most useful in my opinion would be to have the Olson name (America-NY) abbreviated if needed.
from pillar.
Closing, should be possible to implement with the help of tidyverse/tibble#411 or a similar approach.
from pillar.
This old thread has been automatically locked. If you think you have found something related to this, please open a new issue and link to this old issue if necessary.
from pillar.
Related Issues (20)
- Feedback regarding column superscripts HOT 15
- Use of `focus` argument causes an error HOT 2
- Very small numbers print as `Inf.e-324` HOT 6
- Should `*` or `i` be used for footer information? HOT 11
- Truncated list-cols don't seem to get grey coloring HOT 2
- pillar_num and logical vectors cause (potential?) issues
- Installation of pillar 1.9.0 in GitHub actions fails HOT 2
- Should time zones be changing datetime formatting?
- Conditional colouring of values in specific columns HOT 2
- Infinite date-time being printed twice
- Why do `new_pillar_shaft()` and `new_pillar_shaft_simple()` default `min_width` to `width`? HOT 1
- FR: don't print seconds in dttm if there is not enough space
- FR: Add a pillar.max_chars option HOT 1
- Modify tbl_df subclass print in a package HOT 2
- Feature request: Option to print both head and tail of tables? HOT 6
- Use pillar to make column titles red HOT 1
- Guidance colorizing values within a column HOT 2
- The output of `glimpse()` is too wide in RStudio Visual Editor mode HOT 6
- Show colour in `glimpse()` HOT 1
- pillar::num type vector is not properly treated by base::sum (with respect to na.rm=TRUE) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pillar.