This is a third-party script/app and is not created by the WaniKani team. By using this, you understand that it can stop working at any time or be discontinued indefinitely.
This script replaces the original Level Duration script. Unlike the previous one, this script fetches your level unlock date from the API, so it is much more accurate. To do this it relies on WKOF, so you will need to install that first for this to work.
There are a couple of different display options for this script. If you have been on your current for say 4 days and 2 hours, you can choose from these options:
4 days 2 hours
4.1 days on level
4.1 days
4d 2h
4日2時
4日2時 (in the FangSong font)
Nice! I think I’ll switch over to this one but probably make a local modification to make it look a bit more like the old one but without the extra spacing which is a good idea.
I like those CSS changes. I should probably have made the text exactly like the other text from the start. I’ll update the script with that CSS incorporated, but I’ll leave the text as “[number] days on level”.
I’m not sure if WKOF supports it (I think it does), but you should look at the level_progressions endpoint for API v2. We’ve been tracking people’s progress on levels for a while, and those records should contain all the goodness. You can compare when they leveled up (unlocked_at) to when they finished their first lesson (started_at) without having to scan all their assignments for the level.
Oh, that’s neat, thank you. I must have missed this when I scrolled through the documentation. It looks as though you are adding indexed arrays as one levels up; is it correct to fetch unlocked_at for the current level this way? I assume total_count refers to the number of recorded levels.
//array contains the /level_progressions endpoint data
date = array.data[array.total_count - 1].data.unlocked_at
I never used the original, but with my reset the stats site isn’t accurate with this yet and I’d actually been planning to start a spreadsheet just to try and keep track myself for a rough idea, and this is a million times better.
That’ll work! If you need the whole object, there’s always:
var latest_level_up = array.data.pop();
// then you can do latest_level_up.unlocked_at or latest_level_up.started_at
I’d suggest the started_at attribute for calculating the time on the level, though. That’s populated when someone does their first lesson for that level, so completionists who like finishing all their vocab before moving on won’t get the wrong impression.
Thanks! I already updated the script and it’s even neater now. Down to 50 lines compared to the old version’s 300 lines. I don’t know about using started_at though. unlocked_at feels more natural to me, as a user. I’ll ask around and see what people prefer, thanks for the suggestion.
The last row with “margin-bottom: 14px” is not in the script at the moment. If you add this, you would have some extra spacing on the bottom. You can play with those -2px and 14px values a bit and adjust it how you think looks best to you.
Are you aware that it does not print on the mobile version of the website (Firefox 60/ Android 7)? I suppose that is because the “append” instruction does not find any matching pattern.
Indeed I was not. That’s interesting. It works for me with Firefox 59 and Android 6. Are you using the mobile version of the site? I can’t see the level circle at all with the mobile version.