weeklyKey function

String weeklyKey(
  1. String key,
  2. [DateTime? time]
)

Gets the key for the week associated with key.

If time is specified, the key at that time is obtained.

Implementation

String weeklyKey(String key, [DateTime? time]) {
  time ??= DateTime.now();
  return "$key:${time.format("yyyyww")}";
}