Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82276

convert integer to date forma YYYY-MM-DD

$
0
0

hello guys i wanna Foced cell date to format YYYY-MM-DD

i am exportin it with:

$('row c', sheet).each(function () {

                            

                            var value = $('is t', this).text() || $('v', this).text();
                            var count = (value.match(/\n/g) || []).length;
                            
                            var isdate = (new Date(value) !== "Invalid Date") && !isNaN(new Date(value))?true:false;
                            console.log(value); //i get 43742
                            console.log(this);
                            console.log(isdate);
                            

                            if(isDate){
                                $(this).attr('s', 49);
                            }else{
                                if (count == 0) {
                                    $(this).attr('s', styleIndex - 2);
                                } else {
                                    $(this).attr('s', '55');
                                }
                            }
                        });
                        $('row:first c', sheet).attr('s', '32');

need convert 43742 to 2019-10-04 and i think rebuild the node for cell date


Viewing all articles
Browse latest Browse all 82276

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>