Skip to content

Commit

Permalink
Number() instead of parseFloat() in compare (#58)
Browse files Browse the repository at this point in the history
* Number() instead of parseFloat() in compare
Fixes #57
  • Loading branch information
tofsjonas authored Aug 22, 2023
1 parent 88747fd commit fea8676
Show file tree
Hide file tree
Showing 9 changed files with 486 additions and 396 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2.3.2] - 2023-08-22

### Fixed

- `parseFloat()` turned time values like **12:11:11** and **12:23:56** into **12**, sorting them incorrectly. Enter: `Number()`! 🦸‍♂️️

## [2.3.1] - 2023-08-19

### Fixed
Expand Down Expand Up @@ -84,6 +90,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

This CHANGELOG.md was generated with the assistance of [ChatGPT by OpenAI](https://www.openai.com/research/chatgpt).

[2.3.2]: https://github.com/tofsjonas/sortable/releases/tag/2.3.2
[2.3.1]: https://github.com/tofsjonas/sortable/releases/tag/2.3.1
[2.3.0]: https://github.com/tofsjonas/sortable/releases/tag/2.3.0
[2.2.0]: https://github.com/tofsjonas/sortable/releases/tag/2.2.0
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ You can find a simple demo on <https://tofsjonas.github.io/sortable/>

## Factoids

- **1195 bytes** minified. (621 bytes gzipped)
- **1187 bytes** minified. (620 bytes gzipped)

- Works with **JavaScript generated tables**. (since we are using an eventListener)

Expand Down Expand Up @@ -451,4 +451,6 @@ Combine this with `<table class="sortable asc">` to reverse the sort order. Or d

- ...[James Pudson](https://github.com/nepsilon) for the [empty last](#emptynull-rows-always-last) suggestion, AND for finding the "`data-sort` ignored when empty" bug! 🥳️

- ...[Jojo-IO](https://github.com/Jojo-IO) for the finding the "`parseFloat` messes up time values" bug!

[![jsdelivr](https://data.jsdelivr.com/v1/package/gh/tofsjonas/sortable/badge)](https://www.jsdelivr.com/package/gh/tofsjonas/sortable)
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sortable-tablesort",
"version": "2.3.1",
"version": "2.3.2",
"description": "A tiny, Vanilla/Plain JavaScript table sorter",
"scripts": {
"dev": "tsc -w",
Expand Down Expand Up @@ -36,18 +36,18 @@
"@babel/core": "^7.22.10",
"@babel/preset-env": "^7.22.10",
"@testing-library/dom": "^9.3.1",
"@testing-library/jest-dom": "^6.0.0",
"@typescript-eslint/eslint-plugin": "^6.3.0",
"@typescript-eslint/parser": "^6.3.0",
"babel-jest": "^29.6.2",
"@testing-library/jest-dom": "^6.0.1",
"@typescript-eslint/eslint-plugin": "^6.4.1",
"@typescript-eslint/parser": "^6.4.1",
"babel-jest": "^29.6.3",
"eslint": "^8.47.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-prettier": "^5.0.0",
"google-closure-compiler": "^20230802.0.0",
"jest": "^29.6.2",
"jest": "^29.6.3",
"jsdom": "^22.1.0",
"prettier": "^3.0.1",
"sass": "^1.65.1",
"prettier": "^3.0.2",
"sass": "^1.66.1",
"typescript": "^5.1.6"
}
}
Loading

0 comments on commit fea8676

Please sign in to comment.