Comments (10)
from vue-good-table.
Don't sell yourself short friend! You would have done a fine job i'm sure. I used moment to parse/format dates. you can find the changes in version 1.4.0.
from vue-good-table.
Example usage:
you can add a column like so:
{
label: 'Created On',
field: 'createdAt',
type: 'date',
inputFormat: 'YYYYMMDD',
outputFormat: 'MMM Do YY',
filterable: false,
},
and your date should look like '20160423' //depending on the format you specify in inputFormat.
from vue-good-table.
Awesome! Thanks, I appreciate it!
from vue-good-table.
No problem! let me know if you have a problem using it.
from vue-good-table.
I got that working but it looked like there was an error in your sort method.
I had to change
if (this.columns[this.sortColumn].field === 'date') {
x = moment(x + '', this.columns[this.sortColumn].inputFormat);
}
to
if (this.columns[this.sortColumn].type === 'date') {
x = moment(x + '', this.columns[this.sortColumn].inputFormat);
}
Looks like you have it looking at the field name instead of the field type. My field name was "due_date" so it wasn't working at first and I had to go through and change that.
Other than that, it works great. Thanks again!
from vue-good-table.
whoops! good catch... 1 fix coming right up.
from vue-good-table.
v1.4.1
from vue-good-table.
@bbennett36 I just switched out the date parsing/formatting library. Please let me know if all your use cases still work fine? Thank you!
from vue-good-table.
Are you able to use the 'defaultsortby' setting on a date field? Mine doesn''t seem to be working. The regular date sorting is still working perfect though.
from vue-good-table.
Related Issues (20)
- Execute a function once when the dropdown is changed
- How do I add a new row?
- Property "$createElement" was accessed during render but is not defined on instance.
- Highlight search queries
- filter doesn't work in some columns
- Action button not showing when selecting a record using checkbox
- (vue-good-table-NEXT): Unable to dynamically set hidden column value
- searchFn not trigger when clean search key HOT 2
- Is this project active any longer? HOT 3
- 2 Data in 1 Row SearchFilter
- Not fully supported for RTL language HOT 1
- Preserving Selected Rows After Filtering HOT 1
- How to scroll to a specific line on vue good table HOT 4
- Cannot run app with basic table HOT 2
- mode='remote' + dropdownAllowAll enabled and selected >> total changes we should keep currentPerPage to -1
- Editable Component Value Propagation Issue
- Won't render using ts
- Updating the table when row data changes after AJAX requeset
- Customization of the checkboxes
- Style slot cannot be closed after setting table-actions 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 vue-good-table.