phstc/jquery-dateFormat

not working at Edge 41 and IE11?

juicycool92 opened this issue · 2 comments

hello :>
thanks for made nice and easy plugins!!
it's works perfect on Firefox 58, but its not working at Edge and InternetExplorer.

curreny code i write is below
$('#dateId'+i).text(DateFormat.format.date(Date(test[0].date).toString(), "yy년 M월 d일"));
(forgot weird language :-P just my motherlanguage)
test[0].date's string is

Sun Mar 11 2018 15:50:43 GMT+0900

and firefox display as :
probloms1
https://imgur.com/a/VyAFA

but Edge and IE displaying like this :
probloms2

https://imgur.com/a/Sk967

so here is my question,
jquery-dateFormat does not support edge or ie?
if its not, am i did wrong?

im very new at jquery and html, so my best guess is : i used this plugin very wrong way. lol

Thankyou for read, have a nice day

phstc commented

hi @juicycool92

it should work just fine on Edge/IE. I'm wondering if it's something going on with the special characters.

Can you try:

$('#dateId'+i).text(DateFormat.format.date(Date(test[0].date).toString(), "yy M d"));

To see if that works on Edge and IE?

Hello @phstc !
Thanks to reply.
Unfortunatly solution that you sugestion wasnt work, but i got few hints and i finially findout what's porbloms!

i wrote down input date format as
Sun Mar 11 2018 15:50:43 GMT+0900
but turns out, it wasnt. actual date format from server is like this
Sun Mar 11 2018 15:50:43 GMT+0900 (대한민국표준시)
i guess 'javascript standard date type' are included my motherlanguage,
therefore dateFormat didnt recognize input string as other language.(in my case Korean)

$('#dateId'+i).text(DateFormat.format.date(Sun Mar 11 2018 15:50:43 GMT+0900 (대한민국표준시)).toString(), "yy년 M월 d일"));
probloms are looks like this. Date() function understand that js standard date type

I solved probloms to change input date format to IOS format(umm..is it?).

input date string
2018:March:12

code from ejs
$('#dateId'+i).text($.format.date((new Date(test[i++].date)), "yy년 M월 d일"));

output on Edge
solved

Thankyou again for kind reply!

hope someone also helpful!