<commit_before>{% assign direction = include.direction | default: "down" %}
{% assign name = include.name | default: "" %}
{% assign size = include.size | default: "small" %}
{% assign targetDate = include.date | default: site.time | date: "%b/%d/%Y %H:%M %z" %}

{% assign demo = include.demo | default: "false" %}
{% if demo == "true" %}
  {% assign direction = "down" %}
  {% if name == "" %}{% assign name = "demo" %}{% endif %}
{% endif %}

<div class="row countdown countdown-{{ size }}">
    <div class="col-md-2">&nbsp;</div>
    {% if include.size == "large" %}
      <div class="col-md-2"><span class="cd{{ name }}Days">XX</span>&nbsp;<small>days</small></div>
      <div class="col-md-2"><span class="cd{{ name }}Hrs">XX</span>&nbsp;<small>hours</small></div>
      <div class="col-md-2"><span class="cd{{ name }}Mins">XX</span>&nbsp;<small>minutes</small></div>
      <div class="col-md-2"><span class="cd{{ name }}Secs">XX</span>&nbsp;<small>seconds</small></div>
    {% else %}
      <div class="col-md-2"><span class="cd{{ name }}Days">XX</span><br/><small>days</small></div>
      <div class="col-md-2"><span class="cd{{ name }}Hrs">XX</span><br/><small>hours</small></div>
      <div class="col-md-2"><span class="cd{{ name }}Mins">XX</span><br/><small>minutes</small></div>
      <div class="col-md-2"><span class="cd{{ name }}Secs">XX</span><br/><small>seconds</small></div>
    {% endif %}
    <div class="col-md-2">&nbsp;</div>
</div>

<script type="text/javascript">
var CountdownWidget = CountdownWidget || function (opts) {
  var self = this;
  
  var _second = 1000;
  var _minute = _second * 60;
  var _hour = _minute * 60;
  var _day = _hour * 24;
  
  this.name = opts.name;
  this.direction = opts.direction;
  this.targetDate = new Date(opts.targetDate);
  this.demo = opts.demo;
  
  if(this.demo == "true") {
    this.targetDate = new Date();
    this.targetDate.setDate(this.targetDate.getDate() + 3);
  } else {
    this.targetDate = new Date(opts.targetDate);
  }

  this.showRemaining = function() {
    var now = new Date();
    var distance = self.direction == "down" ? (self.targetDate - now) : (now - self.targetDate);
    if(self.direction == "down" && distance < 0) {
      distance = 0;
      clearInterval(self.timer);
    }

    $(".cd" + self.name + "Days").text(Math.floor(distance / _day));
    $(".cd" + self.name + "Hrs").text(Math.floor((distance % _day) / _hour));
    $(".cd" + self.name + "Mins").text(Math.floor((distance % _hour) / _minute));
    $(".cd" + self.name + "Secs").text(Math.floor((distance % _minute) / _second));
  };
  
  this.showRemaining();
  this.timer = setInterval(self.showRemaining, 333);
};

var countdownWidget_{{ name }} = 
new CountdownWidget({
  name: "{{ name }}",
  demo: "{{ demo }}",
  direction: "{{ direction }}",
  targetDate: "{{ targetDate }}"
});
</script><commit_msg>Remove date filter and default value in countdown<commit_after>{% assign direction = include.direction | default: "down" %}
{% assign name = include.name | default: "" %}
{% assign size = include.size | default: "small" %}
{% assign targetDate = include.date %}

{% assign demo = include.demo | default: "false" %}
{% if demo == "true" %}
  {% assign direction = "down" %}
  {% if name == "" %}{% assign name = "demo" %}{% endif %}
{% endif %}

<div class="row countdown countdown-{{ size }}">
    <div class="col-md-2">&nbsp;</div>
    {% if include.size == "large" %}
      <div class="col-md-2"><span class="cd{{ name }}Days">XX</span>&nbsp;<small>days</small></div>
      <div class="col-md-2"><span class="cd{{ name }}Hrs">XX</span>&nbsp;<small>hours</small></div>
      <div class="col-md-2"><span class="cd{{ name }}Mins">XX</span>&nbsp;<small>minutes</small></div>
      <div class="col-md-2"><span class="cd{{ name }}Secs">XX</span>&nbsp;<small>seconds</small></div>
    {% else %}
      <div class="col-md-2"><span class="cd{{ name }}Days">XX</span><br/><small>days</small></div>
      <div class="col-md-2"><span class="cd{{ name }}Hrs">XX</span><br/><small>hours</small></div>
      <div class="col-md-2"><span class="cd{{ name }}Mins">XX</span><br/><small>minutes</small></div>
      <div class="col-md-2"><span class="cd{{ name }}Secs">XX</span><br/><small>seconds</small></div>
    {% endif %}
    <div class="col-md-2">&nbsp;</div>
</div>

<script type="text/javascript">
var CountdownWidget = CountdownWidget || function (opts) {
  var self = this;

  var _second = 1000;
  var _minute = _second * 60;
  var _hour = _minute * 60;
  var _day = _hour * 24;

  this.name = opts.name;
  this.direction = opts.direction;
  this.targetDate = new Date(opts.targetDate);
  this.demo = opts.demo;

  if(this.demo == "true") {
    this.targetDate = new Date();
    this.targetDate.setDate(this.targetDate.getDate() + 3);
  } else {
    this.targetDate = new Date(opts.targetDate);
  }

  this.showRemaining = function() {
    var now = new Date();
    var distance = self.direction == "down" ? (self.targetDate - now) : (now - self.targetDate);
    if(self.direction == "down" && distance < 0) {
      distance = 0;
      clearInterval(self.timer);
    }

    $(".cd" + self.name + "Days").text(Math.floor(distance / _day));
    $(".cd" + self.name + "Hrs").text(Math.floor((distance % _day) / _hour));
    $(".cd" + self.name + "Mins").text(Math.floor((distance % _hour) / _minute));
    $(".cd" + self.name + "Secs").text(Math.floor((distance % _minute) / _second));
  };

  this.showRemaining();
  this.timer = setInterval(self.showRemaining, 333);
};

var countdownWidget_{{ name }} =
new CountdownWidget({
  name: "{{ name }}",
  demo: "{{ demo }}",
  direction: "{{ direction }}",
  targetDate: "{{ targetDate }}"
});
</script>
{'fraction_non_alphanumeric': 0.22728867064188005, 'fraction_numerical': 0.009119607155384075, 'mean_word_length': 3.74459234608985, 'pattern_counts': {'":': 0, '<': 125, '<?xml version=': 0, '>': 123, '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': '2980649', 'n_tokens_mistral': 2069, 'n_tokens_neox': 1952, 'n_words': 400}