export const sortTable = (data, sortKey, direction) => {
const reverse = direction === "ascending" ? 1 : -1;
const so = data.sort((nameA, nameB) => {
const isString = Number.isNaN(Number(nameA)) // true => string
if (isString) {
if (nameA?.[sortKey]?.toUpperCase() < nameB?.[sortKey]?.toUpperCase()) {
return -1 * reverse;
}
if (nameA?.[sortKey]?.toUpperCase() > nameB?.[sortKey]?.toUpperCase()) {
https://www.rhymewithgravy.com/2019/03/28/Setting-Content-Type-for-multipartform-data-values.html
axios.post(`${apiUrl}`, params, {
headers: {
Accept: 'application/json',
'Content-Type': 'multipart/form-data'
}
})
});
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link rel="stylesheet" href="%PUBLIC_URL%/css/bootstrap.css"> | |
<link rel="stylesheet" href="%PUBLIC_URL%/css/home.css"> | |
<link rel="stylesheet" href="%PUBLIC_URL%/css/product.css"> | |
<link rel="stylesheet" href="%PUBLIC_URL%/css/cart.css"> | |
<link rel="stylesheet" href="%PUBLIC_URL%/css/success.css"> | |
<script src="%PUBLIC_URL%/js/jquery-3.3.1.js"></script> | |
<script src="%PUBLIC_URL%/js/bootstrap.js"></script> |
chsh -s /bin/bash
https://stackoverflow.com/a/59795094/5826956
th:first-child, td:first-child{
position: sticky;
left: 0px;
z-index: 1;
}
tr:nth-child(odd) > td{
background-color: #ededed;
/**
*
* @param num : number need formatting
* @param n : to fixed ( number digit behind point number format), default = 2
*/
export function toFixedNoRounding(num, n = 2) {
const reg = new RegExp('^-?\\d+(?:\\.\\d{0,' + n + '})?', 'g');
const a = num.toString().match(reg)[0];
const dot = a.indexOf('.');
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://anhdev.com/2020/03/17/quan-ly-anh-trong-react-native/ |
A quick guide on how to setup Node.js development environment.
nvm allows installing several versions of Node.js to the same system. Sometimes applications require a certain versions of Node.js to work. Having the flexibility of using specific versions can help.
- Open new Terminal window.
.three-dot {
text-overflow: ellipsis;
overflow: hidden;
line-height: 25px;
display: -webkit-box;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
}