Browse Source

rename time_compat module to avoid conflicts. Use new compat module.

Andreas Stenius 9 years ago
parent
commit
b58b6f4391
2 changed files with 7 additions and 3 deletions
  1. 5 2
      src/erlydtl_filters.erl
  2. 2 1
      src/erlydtl_time_compat.erl

+ 5 - 2
src/erlydtl_filters.erl

@@ -48,7 +48,8 @@
         -export([cast_to_float/1,cast_to_integer/1,stringformat_io/7,round/2,unjoin/2,addDefaultURI/1]).
         -export([cast_to_float/1,cast_to_integer/1,stringformat_io/7,round/2,unjoin/2,addDefaultURI/1]).
 -endif.
 -endif.
  
  
- 
+-import(erlydtl_time_compat, [phash2/1, monotonic_time/0, unique_integer/0]).
+
 -export([add/2,
 -export([add/2,
         addslashes/1,
         addslashes/1,
         capfirst/1,
         capfirst/1,
@@ -539,7 +540,9 @@ random(_) ->
     "".
     "".
 
 
 random_num(Value) ->
 random_num(Value) ->
-    _ = random:seed(now()),
+    random:seed(phash2([node()]),
+                monotonic_time(),
+                unique_integer()),
     random:uniform(Value).
     random:uniform(Value).
 
 
 %% random tags to be used when using erlydtl in testing
 %% random tags to be used when using erlydtl in testing

+ 2 - 1
src/time_compat.erl → src/erlydtl_time_compat.erl

@@ -31,7 +31,8 @@
 %% instead of calling the BIFs directly.
 %% instead of calling the BIFs directly.
 %%
 %%
 
 
--module(time_compat).
+%% use own name to avoid conflicts..
+-module(erlydtl_time_compat).
 
 
 %% We don't want warnings about the use of erlang:now/0 in
 %% We don't want warnings about the use of erlang:now/0 in
 %% this module.
 %% this module.