<commit_before>Darkswarm.filter "date_in_words", ->
  (date) ->
    moment(date).fromNow()

Darkswarm.filter "sensible_timeframe", (date_in_wordsFilter)->
  (date) ->
    if moment().add(2, 'days') < moment(date)
      t 'orders_open'
    else
      t('closing') + date_in_wordsFilter(date)<commit_msg>Specify API date format when converting date to string in JS<commit_after>@API_DATETIME_FORMAT = "YYYY-MM-DD HH:mm:SS Z"

Darkswarm.filter "date_in_words", ->
  (date, dateFormat) ->
    dateFormat ?= @API_DATETIME_FORMAT
    moment(date, dateFormat).fromNow()

Darkswarm.filter "sensible_timeframe", (date_in_wordsFilter)->
  (date, dateFormat) ->
    dateFormat ?= @API_DATETIME_FORMAT

    if moment().add(2, 'days') < moment(date, dateFormat)
      t 'orders_open'
    else
      t('closing') + date_in_wordsFilter(date)
{'fraction_non_alphanumeric': 0.14285714285714285, 'fraction_numerical': 0.002421307506053269, 'mean_word_length': 4.37012987012987, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6033681', 'n_tokens_mistral': 299, 'n_tokens_neox': 291, 'n_words': 55}