Skip to content

Commit 59a9d24

Browse files
committed
Minor code refactoring in main ejs template.
1 parent 66221cb commit 59a9d24

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

views/index.ejs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
<%
2+
function recodexIsXmas() {
3+
return (new Date()).getMonth() === 11 && (new Date()).getDate() > 19;
4+
}
5+
%>
16
<!DOCTYPE html>
27
<html>
38
<head <%- head.htmlAttributes.toString() %>
@@ -76,7 +81,7 @@
7681
<%= ((new Date()).getMonth() === 3 && (new Date()).getDate() === 1) ? 'Loudím' : 'Loading' %>...
7782
</div>
7883

79-
<div id="root" class="<%= ((new Date()).getMonth() === 11 && (new Date()).getDate() > 19) ? 'recodexmas' : '' %>">
84+
<div id="root" class="<%= (recodexIsXmas()) ? 'recodexmas' : '' %>">
8085
<%- html %>
8186
</div>
8287
<% if (reduxState) { %>
@@ -87,7 +92,7 @@
8792

8893
<script>
8994
window.__RECODEX_CONFIG__ = <%- config %>;
90-
<%= ((new Date()).getMonth() === 11 && (new Date()).getDate() > 19) ? 'window.recodexmas = true;' : '' %>
95+
<%= (recodexIsXmas()) ? 'window.recodexmas = true;' : '' %>
9196
</script>
9297
<script src="<%= bundle %>"></script>
9398
<script>

0 commit comments

Comments
 (0)