- In v2.24.1,
- Updated weekday & month parsers to better integrate with jQuery Globalize.
- This demo now includes a column for French named weekdays & months.
- Parse Dates with these parsers
- The "Date" column is using the sugar library to parse dates. Make sure to include the sugar library and the sugar-date-parser.
- The "Weekday" column uses the included "weekday" parser. You can modify parser to match whatever language you are using.
- The "Month" column uses the included "month" parser. You can also modify the month names within the parser to match whatever language you are using.
- The "Year" column is just using the included two digit year parser:
- Formats for "mmddyy", "ddmmyy" and "yymmdd" are available
- Within the parser code is a
rangevariable which is set to
50years range, which sets the date be within +/- range of the listed two digit year.
- So if the current year is
2020, and the listed two digit year is
2080 - 2020 > 50), it becomes
- If the listed two digit year is
2050 - 2020 < 50), then it becomes
2050. I hope that makes it clearer.
- Try out the two digit year calculator below the table.
- In v2.14.0, the range can be set using the
dateRangeoption (see the initialization code below).
- The "Time" column is using the built-in time parser which has been always been included with tablesorter .
|Date||Weekday||Weekday (French)||Month||Month (French)||MM/DD/YY||Time|
|next friday||Friday||Vendredi||Aug||Août||02/1/16||12:00 PM|
|the day after tomorrow||Wed||Mer||July||Juillet||01/1/16||13:00|
|May 25th of next year||Tues||Mardi||Nov||Novembre||1/1/15||14:00|
|25 May 2010||Tuesday||Mar||November||Nov||3/1/15||1:58 PM|
|the last day of March||Sat||Sam||December||Décembre||1/15/15||2:10 PM|
|one day before yesterday||Thursday||Jeudi||Feb||Février||5/1/15||4:00 AM|
Two digit year calculator:
two digit year becomes 2020
<!-- blue theme stylesheet with additional css styles added in v2.0.17 --> <link rel="stylesheet" href="../css/theme.blue.css"> <!-- tablesorter plugin --> <script src="../js/jquery.tablesorter.js"></script> <!-- load month, weekday and two digit year parsers --> <script src="../js/parsers/parser-date-month.js"></script> <script src="../js/parsers/parser-date-weekday.js"></script> <script src="../js/parsers/parser-date-two-digit-year.js"></script> <!-- https://sugarjs.com/docs/#/DateParsing --> <script src="../js/sugar.js"></script> <script src="../js/parsers/parser-date.js"></script>
Next up: Applying the filter widget ››