You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Plugins/sorting/farsi-numbers.min.mjs

2 lines
541 B
JavaScript

/*! © SpryMedia Ltd, Behrooz Janfada - datatables.net/license */
import jQuery from"jquery";import DataTable from"datatables.net";let $=jQuery;function farsiToLatin(r){switch(r){case"۰":return 0;case"۱":return 1;case"۲":return 2;case"۳":return 3;case"۴":return 4;case"۵":return 5;case"۶":return 6;case"۷":return 7;case"۸":return 8;case"۹":return 9;default:return 0}}DataTable.ext.type.order["farsi-numbers-pre"]=function(r){for(var e="",t=0;t<r.length;t++)e+=farsiToLatin(r.charAt(t));return parseInt(e)};export default DataTable;