Bug #10146 ยป date_core.c.diff
| ext/date/date_core.c | ||
|---|---|---|
|
static VALUE
|
||
|
d_lite_jisx0301(VALUE self)
|
||
|
{
|
||
|
VALUE s;
|
||
|
VALUE s, result;
|
||
|
get_d1(self);
|
||
|
s = jisx0301_date(m_real_local_jd(dat),
|
||
|
m_real_year(dat));
|
||
|
return strftimev(RSTRING_PTR(s), self, set_tmx);
|
||
|
result = strftimev(RSTRING_PTR(s), self, set_tmx);
|
||
|
RB_GC_GUARD(s);
|
||
|
return result;
|
||
|
}
|
||
|
#ifndef NDEBUG
|
||
| ... | ... | |
|
static VALUE
|
||
|
iso8601_timediv(VALUE self, VALUE n)
|
||
|
{
|
||
|
VALUE fmt;
|
||
|
VALUE fmt, result;
|
||
|
n = to_integer(n);
|
||
|
fmt = rb_usascii_str_new2("T%H:%M:%S");
|
||
| ... | ... | |
|
rb_str_append(fmt, rb_f_sprintf(3, argv));
|
||
|
}
|
||
|
rb_str_append(fmt, rb_usascii_str_new2("%:z"));
|
||
|
return strftimev(RSTRING_PTR(fmt), self, set_tmx);
|
||
|
result = strftimev(RSTRING_PTR(fmt), self, set_tmx);
|
||
|
RB_GC_GUARD(fmt);
|
||
|
return result;
|
||
|
}
|
||
|
/*
|
||
| ... | ... | |
|
static VALUE
|
||
|
dt_lite_jisx0301(int argc, VALUE *argv, VALUE self)
|
||
|
{
|
||
|
VALUE n, s;
|
||
|
VALUE n, s, result;
|
||
|
rb_scan_args(argc, argv, "01", &n);
|
||
| ... | ... | |
|
get_d1(self);
|
||
|
s = jisx0301_date(m_real_local_jd(dat),
|
||
|
m_real_year(dat));
|
||
|
return rb_str_append(strftimev(RSTRING_PTR(s), self, set_tmx),
|
||
|
iso8601_timediv(self, n));
|
||
|
result = rb_str_append(strftimev(RSTRING_PTR(s), self, set_tmx),
|
||
|
iso8601_timediv(self, n));
|
||
|
RB_GC_GUARD(s);
|
||
|
return result;
|
||
|
}
|
||
|
}
|
||