Comments (10)
down the line it would be nice for the sorting to “just work”
I fully agree -- minimal tinkering on user's part!
I will research more into how Wikipedia achieves this, since it's the main source of inspiration for the plugin.
I appreciate the feedback and I am glad that people find Sortable useful!
from obsidian-sortable.
Yes, sorry for the misunderstanding, column annotation was just an idea.
from obsidian-sortable.
Yes, down the line it would be nice for the sorting to “just work” but I totally realise the nature of maintaining open-source projects and not everything can be done - I’ve been there myself on C++ projects…
For now, this is already really useful.
from obsidian-sortable.
Hello,
Thank you for the thorough report!
Currently, as mentioned in the project's README, the plugin supports sorting numerical and string data types. Custom comparator functions are part of the roadmap.
I will look into it and try add support for sorting date-time in the nearest future.
Best,
Alex
from obsidian-sortable.
Thanks for the swift reply. It's certainly not urgent to fix.
I must admit that bit of the README hadn't sunk in, but I might have assumed that there were numerical values. I take your point, though, that they are not.
In the meantime, might it be feasible to fall-back on treating other data types as strings, and sorting their unmodified string representation? This would give the desired value in this, and I suspect many other cases.
from obsidian-sortable.
I believe that's a fair point. There are certainly lots of edge cases (e.g. time zones, currencies etc.), but it's a good step forward.
For the meantime, I'd let let the user specify their preferred datetime format string in the settings and try to parse with that.
Maybe even annotate table's column with the data type?
from obsidian-sortable.
Thanks. How would I do that annotation please? (My tables are generated by dataview)
from obsidian-sortable.
Right, it may be trickier in this case -- there's #6 on the roadmap as well.
from obsidian-sortable.
Oh sorry, I thought you were mentioning an existing feature, maybe I misunderstand. Not to worry.
Thanks for the replies anyway, and thanks again for the useful plugin.
from obsidian-sortable.
To summarize:
At the time of writing, Sortable can only sort numeric and string data types. In your example, all the values from the Dates
column get parsed as numbers, i.e. 2021
, so the order does not change.
Supporting other data types is tracked in #18.
For the immediate future, I will allow the user to specify a date-time format string in plugin's settings and use that to try to parse date-time values.
Again, thank you for reporting. Closing this, as the main issue for this bug will be #18.
from obsidian-sortable.
Related Issues (20)
- Remove table state on pane close (or similar) HOT 1
- Implement parsers for various data types + auto-detect data type
- Submitting Sortable to Community Plugins HOT 4
- Exclude dataview calendar HOT 5
- Issues with installation HOT 3
- Feature request: Live Preview support HOT 11
- FR: Use `Intl.Collator` to sort "naturally" instead of showing 1, 10, 2, 3, etc. HOT 5
- Feature Request: Row Filter HOT 2
- Can't sort according to dates HOT 3
- Live Preview support for native (non-dataview) tables HOT 2
- Sortable in alphabet not date HOT 1
- Unable to sort list of IP Addresses HOT 1
- Hide sort button when there's only table headers/no table content HOT 3
- Sorting by date is flawed HOT 1
- Does not work on a secondary window. HOT 3
- Incorrect MAC addresses sorting HOT 3
- Add comprehensive testing suite
- Sorting is reset to the unsorted state when dataview content is updated HOT 2
- Feature Request: have Sortable ignore tables inside of special class
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 obsidian-sortable.