Created
February 24, 2012 04:17
-
-
Save dustinmm80/1897594 to your computer and use it in GitHub Desktop.
template tags
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ProfileTimezoneMiddleware(GlobalTimezoneMiddleware): | |
def get_tz(self, request): | |
if hasattr(request, 'user') and request.user.is_authenticated() and request.user.has_profile(): | |
profile = request.user.get_profile() | |
return profile.timezone | |
return get_tz_from_request(request) | |
<div class="dealroom-message-timestamp alignright">{{ message.timestamp|to_global_tz|date:'H:i:s' }}</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment