Open ghost opened 7 years ago
This one is a bit tricky... I think essentially there needs to be a way to split it up so that weekdays only occur with 다음
and never 내
. The current format makes this rather difficult so I think it will have to be modified.... I'll have a look at this and get back to you... Thanks for reporting!
I had another look at this and as I mentioned before handling this properly will require a change in the current locale format. Fortunately I have something in mind. I put a hack in for now to fix this until the next major release when that can happen.
Rev: 4c72a71c
Tested on Tuesday September 5th, 2017:
Sugar.Date.create('내일', 'ko'); // tomorrow //--> Sun Sep 10 2017 Sugar.Date.create('오늘', ko') // today //--> Tue Sep 05 2017 Sugar.Date.create('내일', 'ko'); // tomorrow (yet again) //--> Wed Sep 06 2017
I was wondering why creating date of "tomorrow" for the first time shows wrong result, and seems like the following part of locale causing the problem.
so, by combination of 내+일 could be tomorrow(내일) or next sunday(내+일). So Sugar.js returns result of '내일' as tomorrow or next sunday.
But in Korea '내일' never means next sunday, so changing
to
would temporarily fix the problem (by removing the case of '내일=next sunday') However, in this way, creating date by single character of weekdays becomes impossible:
Sugar.Date.create('월', 'ko'); // tomorrow //--> Invalid Date Sugar.Date.create('월요일', 'ko'); // tomorrow //--> Mon Sep 04 2017
Any suggestion to fix this this issue? Thank you, have a nice day :)