mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
save local timezone to conf
saves the user needing to visit AnkiWeb when their timezone has changed
This commit is contained in:
parent
a735ed19ae
commit
4bc33e2f19
1 changed files with 7 additions and 1 deletions
|
@ -30,7 +30,6 @@ import anki.notes
|
|||
import anki.template
|
||||
import anki.find
|
||||
|
||||
|
||||
defaultConf = {
|
||||
# review options
|
||||
'activeDecks': [1],
|
||||
|
@ -50,6 +49,12 @@ defaultConf = {
|
|||
'schedVer': 2,
|
||||
}
|
||||
|
||||
def timezoneOffset():
|
||||
if time.localtime().tm_isdst:
|
||||
return time.altzone//60
|
||||
else:
|
||||
return time.timezone//60
|
||||
|
||||
# this is initialized by storage.Collection
|
||||
class _Collection:
|
||||
|
||||
|
@ -73,6 +78,7 @@ class _Collection:
|
|||
d = datetime.datetime(d.year, d.month, d.day)
|
||||
d += datetime.timedelta(hours=4)
|
||||
self.crt = int(time.mktime(d.timetuple()))
|
||||
self.conf['localOffset'] = timezoneOffset()
|
||||
self._loadScheduler()
|
||||
if not self.conf.get("newBury", False):
|
||||
self.conf['newBury'] = True
|
||||
|
|
Loading…
Reference in a new issue